Hi there,
is it possible to model a reference to "any" (entity) with JPA? Similar to a reference of type Object in Java, which can hold any object.
Thanks for your answer,
Dominik
Hi there,
is it possible to model a reference to "any" (entity) with JPA? Similar to a reference of type Object in Java, which can hold any object.
Thanks for your answer,
Dominik
According to DataNucleus this is not possible (search in this for java.lang.Object): http://www.datanucleus.org/products/accessplatform_1_1/jpa/types.html
For JDO we introduced our our Object-like abstract class called Subject which is annotated for persistence and extended all other persistable object from it. That works in JDO and I think it should work in JPA as well.
You should think about representation of the reference in database.
Object
.@Any
annotation.