openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <>
Subject Unknown primary key
Date Thu, 01 Feb 2007 18:55:25 GMT
Does JPA or OpenJPA have support for what is called unknown primary  
key in the EJB CMP 2.0 spec.  An unknown primary key is the pk of an  
entity bean that does not have a field (or abstract getter/setter)  
for a primary key.  Instead the framework adds a virtual field to the  
bean that contains the primary key.  The bean can get access to the  
primary key instance calling "Object EntityContext.getPrimaryKey()".   
Typically, the unknown primary key is implemented using database  
identity and a java.lang.Long.

I can add a real field to the class via byte code transformation for  
CMP1 entity beans, but would perfer not to.  For CMP2, I'm already  
generating a subclass so I already have a place to put the field.



View raw message