About @Id

api-jpa

getIdentifier(entity)

Return the id of the entity.(Method of javax.persistence.PersistenceUnitUtil)

 
forum_thread

"Unsupported auto value type java.lang.String" when persisting new instance

I don't have a simple test case for this issue, but I'm getting this error: #1 2011-11-02 14:50 I don't have a simple test case for this issue, but I'm getting this error: Exception in thread "ma ...

 
forum_thread

PostUpdate collection null

Hello, I have an entity MyEntity with a collection attribute myCollection. I have an EntityListener on MyEntity with a @PostUpdate method. When I try to access myCollection from the PostUpdate method, this collection is null. If I try to access the collection from the PreUpdate method, the collection is populated. The collection is eagerly fetched. public class MyEntity {     @OneToMany(fetch=FetchType.EAGER)     private ArrayList<OtherEntity> myCollection = new ArrayList<OtherEntity>(); #1 2014-07-13 15:42 Hello, I have an entity MyEntity with a collection attribute myCollection. I have an EntityListener on My ...

 
forum_thread

Rename Application StringIdentity

I don't think JDO supports altering an entity's Application Identity.  Does ObjectDB? @PersistenceCapable public class MyClass implements Serializable, Cloneable{ @Id private StringIdentity id; ... }   #1 2016-08-07 22:59 I don't think JDO supports altering an entity's Application Identity.  Does ObjectDB? @ ...

 
forum_thread

Problem with @UniqueConstraint

It seems there is a problem with @UniqueConstraint. Same annotations using hibernate works fine - an error will be thrown - duplicate name. ObjectDB - no exception will be thrown. with best regardsPeter #1 2011-01-23 15:32 It seems there is a problem with @UniqueConstraint. Same annotations using hibernate works fine - an error will b ...

 
forum_thread

LAZY @ManyToOne field functions as EAGER

In the code example below (also attached) I would like to understand why I am able to print to console a lazy @ManyToOne field after the entity manager closes. There is a switch DO_VIEW_BEFORE_CLOSE, and when it is true the fields are accessed and output before the finding entity manager closes and as expected both a LAZY @ManyToOne field and an EAGER @ManyToOne field are viewable: b.cLazy:{C}[2]"cLazy"
 b.cEager:{C}[3]"cEager" #1 2012-03-14 01:19 In the code example below (also attached) I would like to understand why I am able to print to console a laz ...

 
forum_thread

Null returned by Persistence.createEntityManagerFactory

Hi, So I'm currently having an issue where createEntityManagerFactory returns null. When I run the application on the my local machine through Tomcat it works fine, the odb file is created.    #1 2014-06-12 18:11 Hi, So I'm currently having an issue where createEntityManagerFactory returns null. When I run the ap ...

 
forum_thread

Intermittent: "Attempt to reuse an existing primary key value" when persisting a new instance

Hi,   I don't have a useful test case to expose this issue, but I am getting an intermittent "Attempt to reuse an existing primary key value". In this particular instance, the error is: #1 2011-07-18 11:23 Hi,   I don't have a useful test case to expose this issue, but I am getting an intermittent "At ...

 
forum_thread

Criteria query error: Unexpected query token

Using JPA2, I can save entities now in JBoss, and also fetch them uniquely by id. However, if I try to fetch it by getting back all instances (e.g. findAll, I get the following error:   #1 2011-04-09 10:27 Using JPA2, I can save entities now in JBoss, and also fetch them uniquely by id. However, if I try to fetch it b ...

 
forum_thread

ClassCastException on SELECT NEW ... after UPDATE over Java RMI

Hi, we are using ObjectDB 2.5.4_04 on Linux. Our application, which uses ObjectDb as a DB, exposes a Java RMI interface which allows remote RMI clients to run JPQL queries on the DB. The application internally runs SELECT NEW ... queries. For example: #1 2014-05-15 04:50 Hi, we are using ObjectDB 2.5.4_04 on Linux. Our application, which uses ObjectDb as a DB, exposes a Java ...