About string

forum_thread

Problem with 'where' and date()

Hi, Today I was playing with some date-range queries in explorer and found a small problem. When you try to use queries like this: SELECT o from TestObject o where o.date > :someDate where o.date is java.util.Date, 'where' doesn't work as it should. Results are not filtered by date. There is no such problem in code because we can set Date() object as parameter. However this is hard in explorer. You can find UTC attached to this post.   ... Explorer the format is unknown so parsing a date from a string may be problematic. Is there a generic method in Java that can handle ...

 
forum_thread

problem when primary key value is zero

I am copying data from a postgres database to objectDB. Some of the rows in the postgres table were created by postgres DDL / SQL insert statements and so do not abide by all JPA rules and recommendations, in particular there are some primary keys with value == 0. These cause problems for objectDB, typically "JPA Unexpected argument as primary key". When using eclipselink, there is a workaround that can be added to persistence.xml like this: ...   public static void main ( String [ ] args ) { ...

 
manual

Obtaining a JPA Database Connection

Shows how to use Java/JPA to connect to the ObjectDB Object Database.... file path (absolute or relative) is also accepted. Any string that ends with .odb or .objectdb is considered by ObjectDB to be ...

 
forum_thread

Database absolute filepath

Is there a line of code that can be used to print out my databases absolute path? I have set it as follows: EntityManagerFactory emf = Persistence.createEntityManagerFactory("$objectdb/database/people.odb"); However, the data being shown in *\lib\objectdb\database\people.odb* is different than what is being used in the rest of the application so I think there might be more than one database somehow.... { public static void main ( String [ ] args ) {   ...

 
forum_thread

Field in Generic Class not persisted?

Hi, I am trying to persist a class which is extended from an abstract class - but fields declared inside the abstract class are not persisted - is that expected? I assume it can be done b/c this field can be recovered after serialisation/deserialization. Here is an code to demonstrate the problem Thanks   ...   public static void main ( String [ ] args ) { OBJ6 H = ...

 
forum_thread

PersistenceException: Failed to locate field

Hi, have recently been running into this issue when changing the schema: com.objectdb.o._PersistenceException: Failed to locate field in this case, adding a primitive String field to an Entity. pretty sure that in the past schema evolution would not have triggered errors, is this case, a simple new field, shouldn't the policy be to add a null in that field, or other default for that primitive. ... to locate field in this case, adding a primitive String field to an Entity. pretty sure that in the past schema ...

 
forum_thread

@Unique added afterward is not taken into account

Hello, ... The annotation was added on a given field itemID (String), important point : the annotation was added afterwards (after objects ...

 
forum_thread

multi thread application, id field sporadically null

We are testing objectDB with a multi thread application. Each thread has it's own entityManager created from a common factory. In one thread we receive sometimes an object from the database with the field that is declared as @Id having the value null (what is not correct, we checked that with the explorer). The class is declared like this: ... ... = 1L ;   @ Id public String nodePath ;   ... as soon as we have this behavior ...

 
api-jpa

javax.persistence.SqlResultSetMapping

Specifies the mapping of the result of a native SQL query.(Annotation of JPA)

 
issue

Merge throw exception "Attempt to reuse an existing primary key value"

Hi,   if Id = 0 I got javax.persistence.EntityExistsException: com.objectdb.o.UserException: Attempt to reuse an existing primary key value (ru.dz.train.test.ZeroIdTest$MyEntity:0)   if Id=1 no exception code : ... { public static void main ( String [ ] args ) { ...