This is a migrated thread and some comments may be shown as answers.

Don't allow null with reference types

1 Answer 35 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sheldon Hall
Top achievements
Rank 1
Sheldon Hall asked on 30 Mar 2010, 12:58 PM
Hello,

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

1 Answer, 1 is accepted

Sort by
0
IT-Als
Top achievements
Rank 1
answered on 30 Mar 2010, 01:49 PM
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.

Regards

Henrik
Tags
General Discussions
Asked by
Sheldon Hall
Top achievements
Rank 1
Answers by
IT-Als
Top achievements
Rank 1
Share this question
or