Fornax-Platform
Forum

Re: [Sculptor] uni-directional one-to-many mapping?

by Patrik Nordwall :: Rate this Message:

Reply to Author | View in Thread

Do you need something like this, i.e. Moon doesn't refer back to Planet?

Entity Planet {
   - @Set<Moon> moons
}

Entity Moon {
}


This will result in a uni-directional many association, but will be implemented in the database as many-to-many.

To implement it with an ordinary foreign key in the child table you have to add inverse

Entity Planet {
   - @Set<Moon> moons inverse
}

Doc: http://www.fornax-platform.org/cp/display/fornax/3.+Advanced+Tutorial+(CSC)#3.AdvancedTutorial(CSC)-AdditionalReferenceFeatures

/Patrik

polly.c.chang wrote:
Hi,

Is it possible to map a uni-directional one-to-many mapping?  From looking at the documentation and template code, it looks like one has to mark the Reference as "inverse", which is a bi-directional mapping.  I just want to have a simple uni-directional mapping.

Thanks!
--Polly

 « Return to Thread: [Sculptor] uni-directional one-to-many mapping?