facebook

Bug in EJB3 Facade delete function

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #275058 Reply

    The automatically generated code for the Facade for delete function is:

    entityManager.remove(persistentInstance);

    However, this results in a runtime exception. The correct code should be something like:

    entityManager.remove(entityManager.getReference(Users.class, persistentInstance.getName()));

    Here, Users.java is my entity bean, again, generated by MyEclipse and persistentInstance.getName() will return the value for ID. This is known at the time of Entity Bean generation.

    Will the subscriptions be generous enough to extend my trail period as myself and my team are trying out a lot of features and reporting any bugs as we encounter them?

    Cheers,

    Ashish.

    #275102 Reply

    Riyad Kalla
    Member

    Ashish,
    Thank you for reporting this issue, I’ll send it back to the EJB3 guys and see what they have to say.

    #275119 Reply

    Thanks Riyad.

    Much appreciated.

    Regards,

    Ashish.

    #275283 Reply

    Ashish:

    Key word here is persistentInstance – remove will throw an IllegalArgumentException on a detached instance which is OK with me.
    Both methods have their use, but given a choice, I would prefer the generated methods to stay aligned with the EntityManager API as they now are.

    Regards,
    Jean-Michel

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Bug in EJB3 Facade delete function

You must be logged in to post in the forum log in