Problem with one-to-many association

Hi,

I’m currently evaluating DBVA 3.0 and I’m facing a problem with one-to-many associations (say A 1 --> * B) (mapped as Sets)

When I try to save an instance of A I get the following exception:

Orm.PersistentException: PersistentException ---> System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
   at Orm.Util.ORMInterceptor.IsUnsaved(Object entity)
   at NHibernate.Impl.SessionImpl.SaveOrUpdate(Object obj)
   at Orm.PersistentSession.SaveOrUpdate(Object obj)
   at Orm.PersistentManager.SaveObject(Object obj)

The instance of A is correctly initalized (with no null reference), and its Set member too (all the code is generated by DBVA, I didn’t modify anyting).

When this simple problem will be solved I’ll try to map the association to a … Map, but I don’t see where to specify the index to use as a key in the map in DBVA.

I’m sure these are FAQs, but I didn’t find any clue about them, and saw nothing about this in the documentation.

Thanks in advance for any help,

Jean-Marie

Hi Jean-Marie,

Thank you for your post.

#1 - Null Pointer Exception
Would it be possible for you to send me your project file and sample code to repeat this problem? You can reach me at jick@visual-paradigm.com. Thank you.

#2 - Map
To apply map as collection type:

  1. Right-click on the association, and select Open Specification from popup menu.
  2. Open the ORM Association Detail page.
  3. Select Map from the Collection Type drop down menu.

Synchronize the class diagram to ERD, you would see an Index column is created in the Entity.

Resources:

Article - Using Mouse Gesture to Synchronize Class Diagrams and Entity Relationship Diagrams
http://resource.visual-paradigm.com/tips_and_tricks/db_visual_architect/using_mouse_gesture_to_synchronize_class_diagrams_and_erd.html

Best Regards,
Jick

Hi Jick,

Thank you for your reply:

#1 - Null Pointer Exception : SOLVED
I simply forgot to include one mapping file into the .Net assembly :frowning:

Sorry for this silly question… but I just recommended your products to my client, which will buy it :slight_smile:

Best regards,

Jean-Marie

Hi Jean-Marie,

Thank you for your reply. Not silly question at all. Perhaps we should improve our usability. Thank you for your question, and thank you for recommending our products to your client! :slight_smile:

Could you please tell me about the status of the second issue? Were you able to specify the index column in ERD? Thank you.

Best Regards,
Jick