Hey Paul,
It's not for a single Foo and Bar pair in the app.
I want that for every bi-directional one-to-many in the app and there
are quite a few (and that number is going to grow significantly over
next few months) hence I want this to be a convention that gets
automatically applied as new classes get added to the app, with no
additional coding required.
cheers,
Krzysztof
On 18/03/2011 4:22 PM, Paul Batum wrote:
It looks like you want an IAutomappingOverride.
It looks very similar to a class map, but you just specify your
changes from the default.
http://wiki.fluentnhibernate.org/Auto_mapping#Overrides
On Thu, Mar 17, 2011 at 9:20 AM, Krzysztof Kozmic
<[email protected] <mailto:[email protected]>> wrote:
I'm working with Auto Mapping trying to put NHibernate on top of
existing Oracle database (yeah, I know - awesome).
It basically is the first time I've worked with auto mapping and it's
working just fine except I'm not sure how to approach one-to-many
mappings.
It's simple (pseudocode)
class Foo
{
Bar Bar {get;
set
{
_bar.Foos.Remove(this);
_bar = value;
_bar.Foos.Add(this);
}
}
}
class Bar
{
IList<Foo> Foos {get;set;}
}
So basically
- how to set up the relation properly with inverse = "true" and all
the other gooddies so that NHibernate knows that these properties are
both ends of the same relationship
- while for all other properties I'm using Property access, in here
obviously for the "many" end of the relationship I need to use back
field, so how do I do the exception here for those cases
- I have many more many-to-one relationships in the model but they are
one directional so I need to tell them apart (things like
Item.UpdatedByUser etc)
- this one I guess is obvious but I'll say this anyway - there are
many sets of Foos and Bars like that in the model - so that pseudocode
above is just an example of how things are layed down
I feel like I'm missing bigger picture. I know of different convention
interfaces but they are very fine grained and I feel like to do it
right I need information from multiple, not just one. So what am I
missing here, how should I go about doing it "the right way".
cheers
--
You received this message because you are subscribed to the Google
Groups "Fluent NHibernate" group.
To post to this group, send email to
[email protected]
<mailto:[email protected]>.
To unsubscribe from this group, send email to
[email protected]
<mailto:fluent-nhibernate%[email protected]>.
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en.
--
You received this message because you are subscribed to the Google
Groups "Fluent NHibernate" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en.
--
You received this message because you are subscribed to the Google Groups "Fluent
NHibernate" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en.