ObjectDB ObjectDB

makeTransient() not working on Embedded class

#1

Hi,

I am using JDO and calling PMimpl.makeTransient(object) on an object which has a class of type @EmbeddedOnly in ObjectDB version 2.5.5.b05.

I get then the following error:

com.objectdb.o._JdoUserException: Type quant.phdsc_new.placement_builder.data.Project is not defined as an entity (@Entity is missing)
at com.objectdb.o.JDE.g(JDE.java:126)
at com.objectdb.o.ERR.f(ERR.java:56)
at com.objectdb.o.JDE.f(JDE.java:52)
at com.objectdb.o.OBC.onObjectDBError(OBC.java:1503)
at com.objectdb.jdo.PMImpl.makeTransient(PMImpl.java:1556)
at com.objectdb.jdo.PMImpl.makeTransient(PMImpl.java:1597)

 

The error message is strange as it suggests using @Entity which is a JPA annotation while I am using JDO and PMImpl.

Should I not call the makeTransient() on an @EmbeddedOnly object at all ? Is it working only on @PersistenceCapable objects ?

Thx,

JG

edit
delete
#2

You can invoke makeTransient only on instances of persistence capable classes (in JDO, or entity classes in JPA). Embedded objects are not managed by their own and cannot change state from managed to transient.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.