openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: Mapping of Derived Identities does not work
Date Wed, 13 Feb 2013 14:03:59 GMT
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 <
riccardo.nimser@s2000.tu-chemnitz.de> 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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message