2 Replies Latest reply on May 19, 2005 12:47 AM by Jan Bares

    Embedded attribute override defaults

    Jan Bares Newbie

      Hi,

      it seems that when I use AttributeOverride, the nullable=false from embedded class is lost. I have to specify it again. Is this expected behaviour?

      @Embeddable(access = AccessType.FIELD)
      public class UnitValue
       {
       @Column(nullable=false)
       public Integer value;
      
       @Column(nullable=false)
       public String unit;
       }
      
      @Entity(access = AccessType.FIELD)
      public class Test
       {
       @Embedded({
       @AttributeOverride(name="value",
       column=@Colum(name="maxWeightValue")),
       @AttributeOverride(name="unit",
       column=@Colum(name="maxWeightUnit"))
       })
       public UnitValue maxWeight;
       }