0 Replies Latest reply on Sep 18, 2006 3:03 AM by pippar82

    How to persist an Entity with Object attribute?

    pippar82

      I have a problem when I try to persist an Entity Bean with 1 attribute that is an Object. I search on the web but i don't find nothing. At the end i think it's not possible but I'm not sure.

      @Entity
      @Table(name="TEST")
      public class StatisticaVoto implements Serializable
      {
       private int id;
       private Object o1;
       private Object o2;
      
       public StatisticaVoto() {}
      
       public StatisticaVoto(Object o1, Object o2)
       {
       this.o1 = (Integer)o1;
       this.o2 = (Integer)o2;
       }
      
       @Id
       @GeneratedValue
       public int getId()
       {
       return id;
       }
      
       public void setId(int id)
       {
       this.id = id;
       }
      
       public Object getO1()
       {
       return (Integer)o1;
       }
      
       public void setO1(Object o1)
       {
       this.o1 = (Integer)o1;
       }
      
       public Object getO2()
       {
       return (Integer)o2;
       }
      
       public void setO2(Object o2)
       {
       this.o2 = (Integer)o2;
       }
      }