CascadeStyle bug in ORM mapping files (NET only)

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!! :smiley:

  • class3.hbm.xml relation with class1 mapping is (omitting details):
    <many-to-one … cascade=“save-update” … >
    It’s ok!! :smiley:

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 :shock:

That last “save-update,delete” produces a PersistentExcepcion when initializing NHibernate. :oops: 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” :frowning:

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?

bug6.png

Hello distansia,

Thank you for your post. I will let our engineers know about this problem.

Best regards,
Jick

Hello distansia,

This problem has been fixed. Please download and install the patch at:
http://files3.visual-paradigm.com/200711/Patch/sp1_20071116e/VP_Suite_Windows_3_1_sp1_20071116e.exe

Hope this helps!

Best regards,
Jick