[jboss-user] [EJB 3.0] - Disable ID generation for entity beans temporarily ?

horst21 do-not-reply at jboss.com
Tue Nov 7 09:34:03 EST 2006


Hello, 

I have persistent ejb3 entity beans with an autogenerated id (@GeneratedValue(strategy = GenerationType.AUTO).

Is it possible to disable the id generation of these entity beans for a EntityManager.merge(..) or EntityManager.persist(..) call?

Does anybody have an idea if and how that could work? Maybe I could access and temporarily update the persistence-meta-data? 

I think I need this in order to be able to import an existing object-graph with many relations and thus many foreign keys.
Of course another option would be to manually update the foreign keys with the new ids, but that seems pretty complex to implement and maintain.

Thanks for your help,
Tobias.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983770#3983770

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983770



More information about the jboss-user mailing list