Hi,
I wonder if someone can help me?
I am trying to load an object (Team) which has a OneToOne declaration to another object (Group ).
Code:
@OneToOne()
@JoinColumn(name = "DEFAULT_GENERAL_GROUP_ID", nullable = true)
private Group defaultGeneralGroup ;
In one particular instance I would like Team to have no Group, therefore the value in the DB is 0. The problem is if I try to load the object (Team) with a group value of 0 I get.
Quote:
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.forum.dao.Group#0]
org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:377)
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:145)
IS there a way to tell hibernate to ignore the 0 value and not try to go and get a group of 0? As you can see I have tried using nullable = true.
Many thanks for any help.