You must be using (on purpose or accidentally), the openjpa.RuntimeUnenhancedClasses=supported property. This subclassing enhancement processing was only meant for simple demonstration purposes. It's not meant for production usage. If you use one of the recommended approaches for byte-code enhancement of your entities [1], you'll have much better luck.
Kevin [1] http://openjpa.apache.org/entity-enhancement.html On Tue, Feb 12, 2013 at 9:39 PM, Riccardo < [email protected]> wrote: > Hi all! > > I am trying to use a mapping of derived identities, as specified in the JSR > 317 section 2.4.1 but I get an error if I try to persist an entity. My > entities look like this: > > @Entity > public class User implements Serializable { > @Id > @Column(name = "Id") > private Long id; > > ... > } > > @Entity > public class Inventory implements Serializable { > @Id > @OneToOne > @JoinColumn(name = "Owner", referencedColumnName = "Id") > private User owner; > > ... > } > > If I create a new inventory and try to persist it, I get the following > error: > > - org.apache.openjpa.enhance.de$rini$persistence$User$pcsubclass cannot be > cast to java.lang.Number > > I hope, somebody can tell me, what I am doing wrong. > > > > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/Mapping-of-Derived-Identities-does-not-work-tp7582806.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. >
