I need more info otherwise I won't be able to fix this for 1.0 RTM. On Tue, Aug 25, 2009 at 1:21 AM, James Gregory <[email protected]>wrote:
> Basically, there shouldn't be a way to get a uni-directional many-to-many > when using automapping, as it assumes they are just one-to-many's. So quite > how you're getting to that line of code is beyond me. All the tests I've put > together haven't been able to replicate your issue, so you're going to have > to give me some help on this... Could you put together either a failing test > or a small project that replicates the issue, and then I'll have something > to work from. > > > On Tue, Aug 25, 2009 at 1:17 AM, James Gregory <[email protected]>wrote: > >> I'm guessing those aren't your actual class and property names? Can you >> share the real ones? It'll help with the pairing code. >> >> >> On Sat, Aug 22, 2009 at 7:48 PM, tlyakhov <[email protected]> wrote: >> >>> >>> It's pretty simple, just this: >>> >>> AutoPersistenceModel model = AutoMap.Assembly(oAssembly) >>> >>> .Where(t => t.IsSubclassOf(typeof(RmBaseCore))) >>> >>> .Setup(s => { >>> >>> s.SubclassStrategy = t => >>> SubclassStrategy.Subclass; >>> >>> }) >>> >>> .ForAllTypes(map => map.IgnoreProperties(p => >>> (p.GetCustomAttributes(typeof(RmDeclAttributes.TransientAttribute), >>> true).Length > 0))) >>> >>> >>> .Conventions.Add<FluentConventions.IdConvention>() >>> >>> public class IdConvention : >>> FluentNHibernate.Conventions.IIdConvention >>> { >>> >>> #region >>> IConvention<IIdentityInspector,IIdentityInstance> Members >>> >>> public void Apply >>> (FluentNHibernate.Conventions.Instances.IIdentityInstance instance) >>> { >>> //Default maxlo value is Int16.MaxValue. >>> >>> instance.GeneratedBy.HiLo(Int16.MaxValue.ToString()); >>> } >>> >>> #endregion >>> } >>> >>> I think I just figured it out though... I didn't realize that these >>> two classes have two many-many relationships between them. The two >>> classes in question look like this: >>> >>> class A >>> { >>> public virtual IList<B> M2MRelation1; >>> public virtual IList<B> M2MRelation2; >>> } >>> >>> class B >>> { >>> public virtual IList<A> M2MRelation1; >>> public virtual IList<A> M2MRelation2; >>> } >>> >>> Is it choking because since there are two relationships between these >>> classes, it can't figure out which collection to use for which? Can I >>> solve this with a convention? >>> >>> -Tim >>> >>> On Aug 22, 3:42 am, James Gregory <[email protected]> wrote: >>> > Can you show us your mappings or your automapping setup? >>> > >>> > >>> > >>> > On Sat, Aug 22, 2009 at 7:45 AM, tlyakhov <[email protected]> wrote: >>> > >>> > > I'm getting an error in this code: >>> > >>> > > if (mapping.OtherSide == null) >>> > > { >>> > > // uni-directional >>> > > mapping.SetDefaultValue(x => x.TableName, >>> > > mapping.ChildType.Name + "To" + mapping.ContainingEntityType.Name); >>> > > } >>> > >>> > > On line 15 In ManyToManyTableNameVisitor saying that >>> > > mapping.ContainingEntityType is null. >>> > >>> > > I have no conventions set up that would impact a many-many >>> > > relationship... Any ideas when this could happen? >>> > >>> > > Thanks in advance, >>> > > -Tim >>> >>> >>> >> > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
