All recent work on NHibernate Shards has been done by me, Dario's repository is currently authoritative.
Cheers, Gerke. On 10 May 2014 07:11, <[email protected]> wrote: > Today's topic summary > > Group: http://groups.google.com/group/nhibernate-development/topics > > - Mapping by code: collections of values not > one-to-many?<#145e48aa6f66fb72_group_thread_0>[1 Update] > - NHContrib Still Being Maintained? <#145e48aa6f66fb72_group_thread_1>[1 > Update] > > Mapping by code: collections of values not > one-to-many?<http://groups.google.com/group/nhibernate-development/t/5136f282ba45cf4e> > > Dawid Ciecierski <[email protected]> May 08 09:27PM -0700 > > Hello, > > Let me say upfront that databases are not my area of expertise, so I > may be > saying something that is obviously wrong at first glance. (Apologies > for > wasting your time if this will turn out to be the case.) Secondly, > this > behaviour seems to be related to development a little more than users, > thus > posting here. > > > *The Problem* > SimpleModelInspector does not recognise collections of simple values > (example below) as one-to-many, while in my view such dependent > collections > should automatically be marked as such (as well as inverse). At first > I > thought that this was a glitch and aimed to write a test that would > demonstrate it; however, to my surprise there are already tests > proving *the > opposite* behaviour! > > The tests in question are WhenCollectionOfComponentsThenNoMatch and > WhenCollectionOfElementsThenNoMatch inside OneToManyTests. To my > (untrained) eye it seems they should be demonstrating that a > collection of > components and a collection of elements *should* in fact be marked as > one-to-many (which it is currently not). > > > *Why?* > The particular use case in case you're wondering: having > cascade-on-delete > enabled on collections inside auto-mapped classes: > > public MyClass > { > public IList<string> Tags { get; set; } > } > > public class MyModelMapper : ModelMapper > { > public MyModelMapper() : this(new SimpleModelInspector()) > { > } > > public MyModelMapper(IModelInspector modelInspector) : > base(modelInspector) > { > BeforeMapList += CascadeDeleteForChildCollections; > } > > private void CascadeDeleteForChildCollections( > IModelInspector inspector, > PropertyPath member, > ICollectionPropertiesMapper customizer) > { > if (inspector.IsOneToMany(member.LocalMember)) > { > customizer.Inverse(true): > customizer.Key(k => k.OnDelete(OnDeleteAction.Cascade)); > } > } > } > > (I know it is not always the best+safest idea to casdade, but in this > case > these are some utility tables, and not part of the core business > domain.) > > Please do let me know if I'm wrong and this in fact is not a classic > example of a one-to-many relationship, or if there perhaps exists > another > way to detect such collections with a model inspector and/or have them > auto-SQL-cascade their deletes. > > Best regards, > Dawid Ciecierski > > > > NHContrib Still Being > Maintained?<http://groups.google.com/group/nhibernate-development/t/3b47b95a805a723b> > > Ricardo Peres <[email protected]> May 09 02:59AM -0700 > > Hi, > > I think these projects are still alive, and are worth keeping (I know > Envers is being well treated, I just list it here for reference!): > > > NHibernate Envers (maintained by Roger): > > Source Code: https://bitbucket.org/RogerKratz/nhibernate.envers > > > NHibernate Search (maintained by who?): > > Source Code: https://github.com/nhibernate/NHibernate-Search > > > > NHibernate Validator (maintained by Dario?): > > Source Code: https://github.com/darioquintana/NHibernate-Validator > > > > NHibernate Shards (maintained by Dario?): > > Source Code: https://github.com/darioquintana/NHibernate-Shards > > > > > On Thursday, March 13, 2014 10:06:26 PM UTC, Ricardo Peres wrote: > > > > -- > > --- > You received this message because you are subscribed to the Google Groups > "nhibernate-development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "nhibernate-development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
