4 Replies Latest reply on Nov 20, 2006 6:12 AM by horst21

    Disable ID generation for entity beans temporarily ?

    horst21 Newbie


      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,