0 Replies Latest reply on Jun 3, 2010 9:22 AM by Serkan Eskici

    Embeddable entities persisted as null

    Serkan Eskici Novice

      Hi,


      I'm having the following problem:


      When I try to persist an entity with an embeddable component, then the later gets persisted as null (columns). Even when its values are not null !


      So here is my code:


      @Entity
      public class Customer {
      
        //some primitive attributes
        ...
        
        @Embedded @NotNull  
        private Address address = new Address();  <----- this is an Embeddable with just Strings (street, city, etc.)
      }
      



      <h:form>
      <h:inputText value="#{customer.address.street}" />
      //etc.
      
      
      <h:commandButton action="#{customerHome.persist()}"/>
      </h:form>
      



      And after I enter some values for the Address component and try to persist it, the Address gets not persisted. All its values are null in the database.


      So what's going on ? -This is the first time I encounter this problem...