Hibernate version: 1.2.1
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:attempt to delete null
Name and version of the database you are using:sql server 2005
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I have two class: President, Nation. There are one-to-one relation between them. The Nation is the main class, it has property Persident. The Persident has property Nation, and it's key is generated by the Nation property.
I have a Nation object, and it's Persident is null. When i delete the Nation, it successed, but the delete of Persident is wait to do. So when i access the database next time, it will delete the Persident though the property is null, and throw a exception said: attemped to delete null.
I see the scheam, the one to one relation mapping doesn't has "not-null" attribute as many-to-one relation mapping.
How can deal with this problem?
My mother tongue is not English, I'm sorry.
|