Hello, Why not just create a new instance of the entity and set everything except the id & possibly the version attributes with the values from the detached entity? Or are the id's important to maintain across the DB's?
John > -----Original Message----- > From: Guillaume CHAUVET [mailto:guillaume.chau...@qualiformed.com] > Sent: Friday, May 17, 2013 10:35 AM > To: 'users@openjpa.apache.org' > Subject: RE: Persist detached entities into a memory database > > Thank you for your answer, but maintaining two entities graph just for some > GeneratedValue annotations is an huge workload. We have a fallback > solution, but not very user friendly; Instead of writing this : > @Id > @GeneratedValue // with <property name="openjpa.Sequence" > value="aaaa.bbbb.MyTimestampGenerator"/> > private long id; > > We wrote : > @Id > private long id = MyTimestampGenerator.next(); // Synchronized statical > method to get a new Id. > > However, a most proper solution will may be to provide an new OpenJPA > property that allows to bypass or not the presence of an existing ID value > for > an annoted field with GeneratedValue. > We can reflect on this option, except if there is another way. > > Regards