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.

Reply via email to