Oracle ARC Relationship

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
gr8user
Posts: 16
Joined: Wed 24 Aug 2016 23:45

Oracle ARC Relationship

Post by gr8user » Wed 24 Aug 2016 23:52

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,

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Oracle ARC Relationship

Post by Shalex » Mon 29 Aug 2016 17:07

Please refer to http://www.devart.com/entitydeveloper/e ... eloper.chm (right click > Properties > Unblock).

gr8user
Posts: 16
Joined: Wed 24 Aug 2016 23:45

Re: Oracle ARC Relationship

Post by gr8user » Mon 29 Aug 2016 18:24

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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Oracle ARC Relationship

Post by Shalex » Tue 30 Aug 2016 10:06

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.

gr8user
Posts: 16
Joined: Wed 24 Aug 2016 23:45

Re: Oracle ARC Relationship

Post by gr8user » Tue 30 Aug 2016 16:23

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?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Oracle ARC Relationship

Post by Shalex » Thu 01 Sep 2016 16:35

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.

gr8user
Posts: 16
Joined: Wed 24 Aug 2016 23:45

Re: Oracle ARC Relationship

Post by gr8user » Fri 02 Sep 2016 17:09

Great! Thank you. I'm going to try this approach.

Post Reply