| Author |
Message |
|
2007/11/04 03:43
|
|
|
distansia
Joined: 2007/10/16
Messages: 59
Offline
|
|
|
|
Hi VP,
I have found a bug in the ORM mapping files, related to "cascadestyle" setting. I'm using DB-VA 4.1 sp1 20071116a.
When working with a model like the attached image, here are the mapping results:
* class2.hbm.xml relation with class1 mapping is (omitting details):
<many-to-one ... cascade="save-update" ... >
It's ok!!
* class3.hbm.xml relation with class1 mapping is (omitting details):
<many-to-one ... cascade="save-update" ... >
It's ok!!
But, the mapping for Class1 is:
<one-to-one name="Class2" ... cascade="all-delete-orphan" ... />
<one-to-one name="Class3" ... cascade="save-update,delete" ... />
Oops... it's not ok
That last "save-update,delete" produces a PersistentExcepcion when initializing NHibernate. Combined cascades are not supported in NHibernate 1.2 (I think that they are only on Hibernate 3.x, but not sure).
So, the only available cascade types on NHibernate (.NET) are:
"all", "all-delete-orphan", "none", "save-update", "delete" and "delete-orphan"
What can we do? Use a less efficient "all-delete-orphan" explicitly on the ORM Association End Detail? or maybe the generator should know about this when building NET code?
Attached Image :
Description : Model showcasing the error
(6 kb)
|
|
|
|
 |
| |
|
2007/11/05 09:02
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hello distansia,
Thank you for your post. I will let our engineers know about this problem.
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/11/05 18:32
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
|
 |
| |