About begin

forum_thread

How to define database structure and insert some initial objects from scratch

Hi from Spain! We're evaluating ObjectDB and we have some questions: - How can we create the initial database structure of our application? We know objectdb is all about objects and probably not need initial structure like tables, but how can we populate some "tables" with initial data from a script? In SQL world we have scripts like "insert into..." - Can we use main objectdb.jar library as jdbc driver for ETL software like Kettle? How about migrating data from another database system? ... em. getTransaction ( ) . begin ( ) ; for ( int i = 0 ...

 
forum_thread

JPA JPQL WHERE clause for IN :variable not working if variable is a list of Enums

Hi, I have a case where I have a JPQL query like: "select o from MyEntity o WHERE (enumField IN :enumFieldList)" And enum field is defined in MyEntity as: @Enumerated(EnumType.STRING) @Column(nullable = false) @Index private MyEnumType enumField; And MyEnumType is defined as: public enum MyEnumType { VALUE1, VALUE2, VALUE3, VALUE4 } and I call: ...   em. getTransaction ( ) . begin ( ) ; em. persist ( new MyEntity ...

 
forum_thread

Geospatial functions

Hi, is it possible to implement geospatial functions (e.g. calculating distance between too points given latitude/longitude) ?Normally you would calculate the distance like: ...   em. getTransaction ( ) . begin ( ) ; em. persist ( new Location ...

 
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   ... em. getTransaction ( ) . begin ( ) ; em. persist ( H ) ; ...

 
forum_thread

Unable to persist fields in subclass

I have a superclass Person, with several fields I have a subclass Patient with additional fields. I can persist Patient, but CANNOT persist the fields in this subclass. Why is this? example code: package miscTests; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.MappedSuperclass; ... ;   em. getTransaction ( ) . begin ( ) ; em. persist ( patient ) ...

 
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: ...   em. getTransaction ( ) . begin ( ) ; em. persist ( new MyEntity ...

 
forum_thread

Replicated cluster recovery

If I create a replicated database cluster as per http://www.objectdb.com/java/jpa/tool/replication what is the behaviour of the master database after a failure? For example, say I have MasterDB and SlaveDB in the cluster. If MasterDB goes offline the application will automatically switch to SlaveDB. When MasterDB comes back online it will have missed any activity that occured during the downtime. #1 2011-04-08 16:07 If I create a replicated database cluster as per http://www.objectdb.com/java/jpa/tool/replication what is the be ...

 
forum_thread

Primary key generation problem after changing entity package

Hi, I changed package name for some of my entities in database. I added info in <schema><package... /></schema> of my configuration file - and the changes have been succesfully made in database. Unfortunately, sequences have been probably lost for changed entity classes. After schema change I keep getting errors : Attempt to reuse an existing primary key value... My primary keys are annotated as shown below : ... ; em. getTransaction ( ) . begin ( ) ; em. persist ( new A ( ...

 
forum_thread

Problem with distinct select, order by and equivalent alias/attribute path

Hi, while working with a (standard-)JPA-query generating framework we run into an exception when ordering the results of some projection when the order by expression is different (though logically equivalent) to the projection expression. Here is the example: ...   em. getTransaction ( ) . begin ( ) ;   em. getMetamodel ( ...

 
forum_thread

java.sql.Timestamp with milliseconds

Using JPA with other providers java.util.Date will not provide support to store milliseconds, this can usually be overcome using (see here http://docs.oracle.com/javase/1.5.0/docs/api/java/sql/Timestamp.html) @Id @Column(name = "STMP") @Temporal(TemporalType.TIMESTAMP) private Timestamp timestamp; However with ObjectDB the milliseconds are not being stored, as shown this is an ID field and I am encountering duplicate ID errors trying to create multiple entries in the same second. ...   em. getTransaction ( ) . begin ( ) ; for ( int i = 0 ...