Hibernate: not-null property references a null or transient value?

Up vote 0 down vote favorite share g+ share fb share tw.

I have 2 classes: Msgand Task that are 1-to-1. If I try to save Msg instance without setting Task instance for it I get. Org.hibernate.

PropertyValueException: not-null property references a null or transient value: entity3.Msg. Task How do I enable saving Msg without Task? I have this in mapping file for Msg but its not helping Thanks in advance!

Java hibernate exception entity-relationship link|improve this question asked Nov 24 '11 at 15:45bunnyjesse112148 86% accept rate.

Try modifying your mapping as below, The problem could be because you are having a not-null="true" at the column definition tag. Read here more about hibernate mappings.

Thanks for answer. What do I do in case of one-2-one. How do I modify mapping?

– bunnyjesse112 Nov 24 '11 at 17:31 Read here about one-to-one mapping. – ManuPK Nov 25 '11 at 2:34 it seems that one-2-one, don't have not-null option. – bunnyjesse112 Nov 25 '11 at 7:15.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions