About @Id

forum_thread

Persist error @ManyToMany how to define correct entities relationships

I have Product entities containing a list of Category enties. Each product can have multiple Category but all sue the same limited set of Category entities. There is not changes made to Category from Product. The category ID is taken from the webservice Object ID (unique too). #1 2017-01-29 18:06 I have Product entities containing a list of Category enties. Each product can have multiple Category but they ar ...

 
manual

JPA Primary Key

Explains how to define and use primary keys in JPA, including composite and embedded primary keys.... public class Project { @Id javax.persistence.Id JPA annotation Specifies the primary ... set automatically : } The @Id javax.persistence.Id JPA annotation Specifies the ...

 
forum_thread

c.o.jpa.type.EntityTypeImpl.getIdType() returns null

hi, i currently try to use objectdb for a new project. i wanted to use it in combination with spring-data-jpa (M2), but i'm not able to use the automatic repository feature because the following code fails         EntityType<T> type = metamodel.entity(domainClass); #1 2011-04-29 05:55 hi, i currently try to use objectdb for a new project. i wanted to use it in combination with spring-data ...

 
forum_thread

Need help to make this test work and define proper annotations for entities Lists

Hi, I can't get this simple test case to work, i know it is probably due to the lack of proper annotations on entities list, could anyone help me to define them? NB in this test case I didn't set all entities methods for the sake of clarity, also in actual application no field are public nor static and no entity is static.    #1 2016-08-19 00:32 Hi, I can't get this simple test case to work, i know it is probably due to the lack of proper annota ...

 
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 : Bug Version: 2.6.2 Priority: Critical Status: Fixed Replies: 2 Type:  Bug ...

 
issue

When using inheritance, you can specify, which ID to use

When storing objects with inheritance, it should be possible to choose, which ID (parent or child class) should be used for new object. For example: public EntityA() {     @Id     long id;     String field1; }   Feature Request Version: 2.0.5 Priority: Normal Status: Active Replies: 0 Type:  Feature Request ...

 
forum_thread

Left join fetch behaviour doesn't retrieve children?

Hello support, I'm a little bit confused about a left join fetch behaviour. In this test case, i try to fetch my 3 children using a left join fetch. But my collection is null after closing the em. It was expected to be fetched before closing the em, no ? In fact, that is the objective of the fetch purpose (i guess ?). #1 2015-06-07 07:34 Hello, I'm a little bit confused about a left join fetch behaviour. In this test case, i try ...

 
forum_thread

On ensuring ID available after persist

This reports on a possible solution to a common problem: I was trialling ObjectDB on an existing, functioning, large JavaEE/JPA web application, which until now had used EclipseLink+MySQL and then Oracle+MySQL. On trying it out on ObjectDB I hit a problem with my very extensive entity wiring code, which relies on an "external" entity object having a non-null id after it has been passed to EntityManager.persist, thus: #1 2011-05-31 00:39 This reports on a possible solution to a common problem: I was trialling ObjectDB on an existing, functio ...

 
forum_thread

ID format in objectdb 2.x for JDOHelper.getObjectId

Hi, I am trying to upgrade the objectdb from 1.x to 2.x. I installed and configured as per object db tuotrial. I am just wondering, in objectdb 1.x, when i am tring to get the object id for a persistable object, i am getting an integer as a result e.g Object obj = JDOHelper.getObjectId(logTestRunImpl) used to return suppose 1 obj.toString() = 1 but the same code when i am trying to execute for the same object in object db 2.x, i am getting ... not LongIdentity. I tried adding private @Id @GeneratedValue long id; but i think it only works in case of JPA not with ...

 
forum_thread

Should derived fields of an EmbeddedId be manually maintained by app code?

If I have an Entity which has a primary key which is derived and I am implementing it using @EmbeddedId, am I responsible for maintaining the derived fields of the @EmbeddedId? I could not find anything in the JPA 2.0 spec http://download.oracle.com/auth/otn-pub/jcp/persistence-2.0-fr-oth-JSpec/persistence-2_0-final-spec.pdf?e=1317047713&h=54831c176e81a244a4c309e13eba0b27 which tells me what to expect. #1 2011-09-26 15:26 If I have an Entity which has a primary key which is derived and I am implementing it using @EmbeddedId, am I res ...