3 Replies Latest reply on Jun 3, 2010 11:10 AM by Serkan Eskici

    Using an @Embeddable class as seam component problem

    I need a real name Newbie
      I have an @Embeddable class called Comment. This is also a seam component. I am setting the properties of the component using a form in the interface. Then i inject the specified component into an action class and try to persist it to the database adding the comment to the collection of comments for a product. The Product class is an entity. I don't know why but when hibernate persists the comment to the database it inserts null values for all the fields even if thy are set from the interface. So the insert fails displaying this message:

      WARN  [JDBCExceptionReporter] SQL Error: 1048, SQLState: 23000||
      ERROR [JDBCExceptionReporter] Column 'COMMENT_USERNAME' cannot be null
      ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
      org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update


      Please help me!