Metaproperty nullable in domain model

Thread is closed for posting
2 posts, 0 answers
  1. Jonathan Simmons
    Jonathan Simmons avatar
    108 posts
    Member since:
    Jun 2005

    Posted 12 Aug 2010 Link to this post

    Just a quick question.
    I have created a new domain model from an existing database and have noted that the nullable property of some of the items in a class do not correspond to the nullable property of the field in the database. For example, the domain model diagram for an object named SiteService has an element named Zonenumber which has the nullable metaproperty = False but in the database table which this object is mapped to, the corresponding field is nullable. The reverse is also true - not nullable field definitions in the table are nullable in the model.

    Why are these two 'nullabilities' not the same?

  2. Petko_I
    Petko_I avatar
    184 posts

    Posted 16 Aug 2010 Link to this post

    Hi Jonathan Simmons,

    The nullable facet of a property indicates whether the property in the class can be null and by default the facet value is set to false. It is separated from the null behavior in the database (the column nullable attribute in the .rlinq file). There are scenarios where this separation comes in handy. For example, you have a legacy database where many columns allow null, you want to forbid the null values in some of these columns and instead of changing the database schema you can enforce a rule in the conceptual layer. You can nevertheless change the null option for a column with the help of our Table Editor – right-click on a column in the Model Schema Explorer, select Edit column and check/uncheck the Allow nulls check box. To propagate the changes to the database you will need to interact with the Update Database From Model wizard and execute a schema migration script.

    Do not hesitate to contact us if you want to suggest improvements or you want to discuss further this or other issues.

    Sincerely yours,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top