openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hans J. Prueller" <hans.pruel...@gmx.net>
Subject state-of-the art attribute initialization in persistent pojos?
Date Thu, 12 Apr 2007 15:43:52 GMT
hi,

 

as you know I am switching from EJB2.1 CMP to JPA (OpenJPA). I'd like to
know the preferred way to perform attribute initialisation

of newly created entity instances, e.g. 

 

we initialized our EJB2.1 CMP entity beans with

 

ejbCreate(String cid, Integer someOtherValue)

{

setabc();

setdef();

}

//and ejbPostCreate optionally

 

as far as I know, the JPA spec requires a no-arg constructor - so when
providing a constructor with the same args that we

have used in ejbCreate before, we cannot ensure that some developer calls
the no-arg constructor by default.

 

is there any other-more elegant way to force new entity instance
initialization?

 

regards,

HANS

 

=========================== 
virtually hanzz...

 

 <http://hanzz.zapto.org> http://hanzz.zapto.org (personal)
 <http://www.cse.dmu.ac.uk/~hansp> http://www.cse.dmu.ac.uk/~hansp
(research)

 


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