0 Replies Latest reply on Mar 13, 2006 5:28 PM by Mark Determan

    Enity Bean Mapping

    Mark Determan Newbie

      What i need to do is get one value from another enity for use and I don't need the whole object just one value

      public class Object1 implements Serializable {
       pirvate Integer id;
       private String name;
      
       public Integer getId() {return id;}
      
       @Id
       public void setId(Integer id) {this.id = id;}
      
       ...
      }
      
      public class Object2 implements Serializable {
       pirvate Integer id;
       private Integer object1Id
       private String object1Name
      
       public Integer getId() {return id;}
      
       @Id
       public void setId(Integer id) {this.id = id;}
      
       public Integer getObject1Id() {return object1Id;}
      
       public void setObject1Id(Integer object1Id) {this.object1Id = object1Id;}
      
       public String getObject1Name() {return object1Name;}
      
      }


      Where getObject1Name in Object2 i would like that to be the value of Object 1's Name by a relationship of a Object 1 can have many Object 2's but Ojbect 2's can only have one Object 1's.