122 words

makeTransient() not working on Embedded class

#1
2014-07-05 00:24

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

jakab
jakab's picture
Joined on 2011-05-12
User Post #8
#2
2014-07-06 11:35

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
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,986

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel