Page 1 of 1
Oracle ARC Relationship
Posted: Wed 24 Aug 2016 23:52
by gr8user
Hi,
I need to create ARC relationship for Oracle between 3 tables: applicant, people, organisations. Applicant can be company or individual, but nor both. How can it be done in data model using Entity Developer?
Thanks,
Re: Oracle ARC Relationship
Posted: Mon 29 Aug 2016 17:07
by Shalex
Please refer to
http://www.devart.com/entitydeveloper/e ... eloper.chm (right click > Properties > Unblock).
Re: Oracle ARC Relationship
Posted: Mon 29 Aug 2016 18:24
by gr8user
I'm sorry, something doesn't work on my computer. Property of what object should I look?
I can add 2 columns to class , set both them as not required. But can be set next rule:
both columns cannot be null or both columns cannot be populated at the same time?
Thanks
Re: Oracle ARC Relationship
Posted: Tue 30 Aug 2016 10:06
by Shalex
1. Are you using the Entity Framework (*.edml) model? Or is it Entity Framework Core (*.efml) or NHibernate (*.hbml) or Telerik Data Access (*.daml) or LinqConnect (*.lqml)?
2. Refer to
http://www.devart.com/entitydeveloper/e ... eloper.chm (right click > Properties > Unblock), open the ORM Support node > choose your ORM > Concepts > Working with Associations.
If this doesn't help,
send us a test model and specify the exact steps we should follow for reproducing the issue.
Re: Oracle ARC Relationship
Posted: Tue 30 Aug 2016 16:23
by gr8user
Hi,
For example customer table has person and organization columns.
In human words arc constraint is checking one of these columns should be populated , but not both.
These columns both set up as nullable, but have foreign keys to related person and organisation tables. Arc constraint looks like this:
===========
( (ORGANIZATION_ID IS NOT NULL) AND (PERSON_ID IS NULL) )
OR ( (PERSON_ID IS NOT NULL) AND (ORGANIZATION_ID IS NULL) )
===============
Does NHibernate (*.hbml) have ability to picked up these 2 columns in PERSON table and force to create check constraint automatically, if foreign constraints are set up for person and organisation columns to person and organisation tables in person table?
Re: Oracle ARC Relationship
Posted: Thu 01 Sep 2016 16:35
by Shalex
gr8user wrote:For example customer table has person and organization columns.
In human words arc constraint is checking one of these columns should be populated , but not both.
Take a look at TPH inheritance (instead of implementing association):
In this case the discriminator column could determine whether this instance is a person or an organization.
Re: Oracle ARC Relationship
Posted: Fri 02 Sep 2016 17:09
by gr8user
Great! Thank you. I'm going to try this approach.