0

Using ObjectDB [ObjectDB 2.4.1] javax.jdo.JDOUserException Attempt to store an instance of a non persistable type com.A

@PersistenceCapable
public abstract class B
{
...
@Embedded
protected com.A a = new A();

}

Unfortunately we have been using class A from a library for many years and don't have source available anymore and I cannot put PersistenceCapable annotation on com.A.java. What can I do?

Edit

I think the answer is to add package.jdo for class A. But I still don't understand why is JDO making me either add annotation or make an entry in .jdo file for every class that i want to persist. I wish this could somehow be driven by Serializable interface.

ObjectDB
  • 1,312
  • 8
  • 9
dc360
  • 215
  • 3
  • 3

1 Answers1

0

Serialization in ObjectDB is disabled by default, in order to encourage using JPA/JDO persistable types (entity classes, persistence capable classes, embeddable classes), which are more efficient, whenever possible.

However, when serialization is required you can enable it, as explained in the ObjectDB manual.

and then you should be able to store instances of serializable instances in your ObjectDB database.

ObjectDB
  • 1,312
  • 8
  • 9