1 Reply Latest reply on Jan 19, 2006 6:29 AM by José Luis Barrera

    Question about perfomance in persistence of objects

    Luis Gervaso Newbie

      Hello,

      Supose we have an EntityBean called Person.java

      Person.java

      private Long id;
      private String name;
      private Country country;

      A Second Entity obiously is Country :)

      Country.java

      private Long id;
      private String name;

      And finally we have a method called savePerson which uses EJB 3.0 API internally, so


      public savePerson(String name, long countryId) {
      ...
      }

      MI QUESTION:

      We have only countryId, but not the entire object Country, so
      is necesary retrieve first the Country object from database using entitymanager?

      is posible avoid this foo step and use a proxy or what ever you like?

      in hibernate is posible using load() i think, but i like avoid use hibernate api explicity (in my source code)

      thanks in advance

      kodaky