Beginner |
|
Joined: Wed May 05, 2004 12:45 pm Posts: 21
|
Hibernate version:
Mapping documents:
<class name="Many" table="MANY"> <id name="id" type="long" unsaved-value="null"> <column name="ID" sql-type="NUMBER" not-null="true"/> <generator class="assigned"/> </id> <component name="manyhasOne" class="ManyhasOne" insert="false" update="false"> <many-to-one name="One" class="One" cascade="all" column="ONE_FID" unique="true"/> </component> </class>
<class name="One" table="ONE" schema="NRVIS"> <id name="is" type="long" unsaved-value="null"> <column name="ID" sql-type="NUMBER" not-null="true"/> <generator class="assigned"/> </id> </class>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs: net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 151164658
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Hi,
In db I have two tables where a relationship amongst them is many-to-one. Many side corresponds to the parent. In the db there is a record on the many side but no corresponding record on the one side. Db doesn't have the actual fk but the fk logic is kept in meta data tables. I mapped it as a many-to-one relationship in the mappings. When I use retrieve if finds the record on the many side but throws an exception when trying to find record on the one side.
net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 151164658
Is it possible to specify in the mappings so that hibernate doesn't need the record on the 1 side. I can not specify the property in the where clause because i have a large tree and don't know where a problem might occur on what property.
Thank you very much
|
|