1 Reply Latest reply on Aug 7, 2013 4:15 PM by Wolf-Dieter Fink

    Calling entity bean mutators in client class and business methods in session Class?

    jashan07 Newbie

      Hi,

       

      I am migrating my ejb 2.1 application into ejb 3.0. I have done following changes:

       

       

      EJB 2.xEJB3.0
      1
      Entity beans implements EntityBean having callback methods and abstract getters and setters.
      Entitybeans with annotation @Entity, removing all callback methods and putting getters and setters
      2
      Home Interface containing business methods
      removing Home Interface and putting business methods in Remote interface
      3
      Remote Interface having getters nad setters
      Removed, putting getter and setters in Bean class
      4
      Session Bean
      same but putting annotation @ stateless and changing jndis
      5
      Client class
      same but changing jndi
      6ejb-jar.xmlRemoving ejb-jar.xml
      7weblogic-cmp-rdbms-jar.xmlRemoving weblogic-cmp-rdbms-jar.xml
      8weblogic-jar.xmlRemoving weblogic-jar.xml

       

      My doubts are :

      1. There are some methods like findbyPrimarykey(int id) and findLoginDetails(int id) which are mapped with queries in ejb-jar.xml. We are writing these queries in Entity bean class using annotations. I was calling these methods in session bean class using Remote interface object in ejb 2.x but now in EJB 3.0 how to define these methods and call these methods in session bean , we are not using ejb-jar.xml anymore.

       

      2. In my client class, i want to access getters which are now defined in Bean class. how can i access it. Do i need to create object of EntityBean class using new operator or some other way. I am creating obj using JNDI and type casting into remote interface. but how to access getters from bean class. I am not clear.

       

       

      Please help me out to resolve these two issues.

       

       

       

      Thanks