About Id

api-jpa

javax.persistence.IdClass

Specifies a composite primary key class that is mapped to multiple fields or properties of the entity.(Annotation of JPA)

 
forum_thread

Entity with java.util.Date column gives ClassCastException in BIRT

Copied a straightforward entity class from my coleague. Using Eclipse Kepler (Reporting) and stored it in ObjectDB 2.5.3_02. After creating an ObjectDB BIRT DataSource and a DataSet, entered a simple JPQL query to select the fields. Entity looks like this: ... public class Patient {   @ Id @ GeneratedValue ( strategy = ... . IDENTITY ) private long id ;   private String name ;   private ... empty }   /** * Returns the id of this {@link Patient} * @return the id */ public ...

 
forum_thread

Multi part paths in a composite index must have the same length

Hi, I am trying to create some index in a DB - but I get an exception when i try to commit. Exception in thread "main" [ObjectDB 2.6.0_01] javax.persistence.PersistenceException Invalid index path 'tStamp.value / instrumentId' in type Entities.OrderBookNew (error 328) at com.objectdb.jpa.EMImpl.createQuery(EMImpl.java:958)   Here is how the class of the persisted object looks like ... long serialVersionUID = 998L ; @ Id @ GeneratedValue long id ; @ Index private Long instrumentId ; private ...

 
manual

Auto Generated Values

Explains the different strategies for generating auto values (mainly for primary key fields) in JPA.... public class EntityWithAutoId1 { @Id javax.persistence.Id JPA annotation Specifies the primary key of an entity. See ...

 
forum_thread

can't get HashMap out of the database

I'm trying to persist an Entity containing a HashMap. It stores the data in the database OK, but the map is always empty when I get the entity out of the database again. I've reproduced this problem in a simple variation of the Guestbook tutorial: Guest class: ===================== ... 1L ;   // Persistent Fields: @ Id @ GeneratedValue Long id ; private String name ; private Date signingDate ; ...

 
forum_thread

How do I achieve a Deep Fetch using JOIN FETCH?

I have an Entity type which is contains a collection of Embeddable objects, which in turn themselves contain a collection of Embeddable objects: @Embeddable class A { String val; }; @Embeddable class B { List<A> aList; }; @Entity class C { @Id long id; List<B> bList; };   Usually I'm content to have the B's and A's be lazily loaded, but I have a circumstance where I need to be able to work with the whole C object, with all its parts, as a detached object. ... @ Entity class C { @ Id long id ; List<B> bList ; } ;   ...

 
issue

NullPointerException when using multithreading

[ObjectDB 2.4.4_08] Unexpected exception (Error 990)   Generated by Java HotSpot(TM) Client VM 1.6.0_29 (on Windows 7 6.1). Please report this error on http://www.objectdb.com/database/issue/new com.objectdb.o.InternalException: java.lang.NullPointerException: null java.lang.NullPointerException at com.objectdb.o.ENT.C(ENT.java:557) at com.objectdb.o.OBM.bz(OBM.java:385) at com.objectdb.o.OBM.bz(OBM.java:261) at com.objectdb.jpa.EMImpl.persist(EMImpl.java:377) at ... ... public class MyEntity {   @ Id private int firstId ; @ Id private String secondId ;   @ OneToOne ( ...

 
forum_thread

Extra uninitialised entities spawned on merge()

In the following, Element is a base entity class, with a bi-directional @ManyToOne-@OneToMany relationship Element owner - List<Element> ownedElements, and Example is a subclass entity with a relationship @OneToOne Element child. ... ) . commit ( ) ; Long id = root. getId ( ) ;   root = em. find ( Element . class , id ) ; //now detached, since outside transaction Example ...

 
forum_thread

Object as parameter results in exception

Hi,    I've got a simple JPA2 Criteria query which fails when doing an object equality. I verified this against EclipseLink and over there, it works. I'll Attach some code snippets to help figure it out:   @Entity() public class Product{ . . . @ManyToOne     private Compamy owningCompany; } @Entity() public class Company{    .    .    .     @Id    private Long id; } and the query: ... class Company { . . . @ Id private Long id ; } and the query:   @ ...

 
page

ObjectDB Object Database Features

ObjectDB provides a rich set of features, many of them as the result of supporting the JPA and JDO APIs.... is an entity. See JavaDoc Reference Page... , @Id javax.persistence.Id JPA annotation Specifies the primary key of an entity. See ...