1 Reply Latest reply on Apr 24, 2006 12:56 PM by Andrew

    @IfInvalid not working?

    Andrew Apprentice

      I'm getting the following error:

      Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.bethanyefree.data.conference.BreakoutSessionRegistration.registration
       at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
       at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:264)
       at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:166)
       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:113)
       at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
       at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
       at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:643)
      


      This occurs after the following method is called:
      @Name("confRegister")
      @Interceptors(SeamInterceptor.class)
      @Stateful
      @Scope(ScopeType.CONVERSATION)
      @Intercept(InterceptionType.ALWAYS)
      @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
      public class ConferenceRegistrationAction
       implements ConferenceRegistration, Serializable {
      ...
       @Valid
       private Registration registration;
      ...
       @End(ifOutcome={"saved"})
       @TransactionAttribute(TransactionAttributeType.REQUIRED)
       @IfInvalid(outcome=Outcome.REDISPLAY)
       public String save()
       {
       entityManager.merge(this.registration);
       return "saved";
       }
      ...
      


      How is it possible that the a validation error is coming through? If the new hibernate-annotations is being used (I hope it is), bug #208 makes sure that recursive validations are checked on collections (which is what I have in the registration class).

      Thanks,
      -Andrew