Don't allow null with reference types

Thread is closed for posting
2 posts, 0 answers
  1. Sheldon Hall
    Sheldon Hall avatar
    4 posts
    Member since:
    Mar 2010

    Posted 30 Mar 2010 Link to this post


    I was wondering if there was a way with forward mapping to make reference types not null-able. Is there a way to enforce this in the ORM?

    Therefore when saving an object (say A) that has a reference type property to another class (say B), we would have to create an object of type B and assign it to A's property or else A won't have saved successfully?

    Thank You
  2. IT-Als
    IT-Als avatar
    381 posts
    Member since:
    Sep 2008

    Posted 30 Mar 2010 Link to this post

    Hi Sheldon,

    In the forward mapping wizard there a setting (checkbox, default unchecked) for the field that has the reference called "Throw exception if null)... Check this checkbox and you get the behavior.


Back to Top