Visual Paradigm Logo
     Build Quality Applications Faster, Better and Cheaper
 
Home | Products | Download | Documentation | Support | Resources | Partners | Quick Tour | Shop | Company |  
 
   Visual Paradigm Discussion Forum
  Login   [ Register ] Email: Password: Log me on automatically I lost my password  
Recent Topics
Advanced Search
CascadeStyle bug in ORM mapping files (NET only)  
Forum Index -> DB Visual ARCHITECT (DB-VA)
Author Message
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)

 
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
 
Jick


Joined: 2005/04/29
Messages: 2880

Offline

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

Visual Paradigm International Ltd.
http://www.visual-paradigm.com

Build Quality Applications Faster, Better and Cheaper
 
 
   Forum Index -> DB Visual ARCHITECT (DB-VA)
Go to:   
Powered by JForum 2.1.4 © 2005 - Rafael Steil