1 Reply Latest reply on Jul 28, 2005 8:33 AM by srose

    Getting error: Not-null property references a null or transi

    srose

      I am using the hibernate validator classes in my session beans to validate my not null fields which are defined in my entity beans. I however get the exception "not-null property references a null or transient value" When I try to use the entity manager to remove any entity with the not null annotation in it. If I remove the @not null annotation, I can remove it but am not able to validate fields which are not null. Any help would be greatly appreciated.

        • 1. Re: Getting error: Not-null property references a null or tr
          srose

          I figured it out. I was setting a entity beans primary key value then passing it into the session bean method which then calls the entity manager remove method. This works fine when I do not have a notnull constraint defined in the entity bean but when there are not null fields, it tries to validate those fields before deleting. I fixed it by using the primary key to get a instance of the entity bean I am about to delete. This is probably a better practice anyways and seems to work well. Hope this helps anyone else who has had this problem.