Just to make sure that you really do have the latest code, take a look in
the Fluent NHibernate source code at
FluentNHibernate\Mapping\MappingPartComparer.cs or using Reflector and make
sure that it looks like this:
using System;
using System.Collections.Generic;
using System.Linq;
namespace FluentNHibernate.Mapping
{
public class MappingPartComparer : IComparer<IMappingPart>
{
private readonly IMappingPart[] originalPartOrder;
public MappingPartComparer(IEnumerable<IMappingPart>
originalCollection)
{
//We create a copy of the collection to maintain the order in
which the elements were originally added
originalPartOrder = originalCollection.ToArray();
}
public int Compare(IMappingPart x, IMappingPart y)
{
//General Position
if (x.PositionOnDocument != y.PositionOnDocument) return
x.PositionOnDocument.CompareTo(y.PositionOnDocument);
//Sub-Position if positions are the same
if (x.LevelWithinPosition != y.LevelWithinPosition) return
x.LevelWithinPosition.CompareTo(y.LevelWithinPosition);
//Relative Index based on the order the part was added
return Array.IndexOf(originalPartOrder,
x).CompareTo(Array.IndexOf(originalPartOrder, y));
}
}
}
On Fri, Apr 17, 2009 at 10:38 PM, MaggiePlusPlus
<[email protected]>wrote:
>
> Any ideas?
>
> On Apr 16, 3:00 pm, Hudson Akridge <[email protected]> wrote:
> > I'll take a look at it, thanks!
> >
> > On Thu, Apr 16, 2009 at 1:02 PM, MaggiePlusPlus
> > <[email protected]>wrote:
> >
> >
> >
> > > I just put a sample in a new thread as I wasn't sure if my problem was
> > > the same since I'm not using SessionSource.
> >
> > >http://groups.google.com/group/fluent-nhibernate/browse_thread/thread.
> ..
> >
> > > On Apr 16, 1:26 pm, Hudson Akridge <[email protected]> wrote:
> > > > Well, the 444 revision fixes it in terms of it passes the test Jon
> wrote
> > > > after I made the changes. Can you write a test or give me a scenario
> > > where
> > > > it's not ordering correctly? I did implement the retaining column
> order
> > > fix
> > > > differently than Jon, so it's possible that there's a scenario you've
> got
> > > > where it did not get fixed and I'd need to account for.
> >
> > > > On Thu, Apr 16, 2009 at 9:30 AM, MaggiePlusPlus
> > > > <[email protected]>wrote:
> >
> > > > > This patch says it was fixed in v444 yet it is not in v447 - I am
> > > > > still very new to this; do I need to manually add the patch?
> >
> > > > > On Apr 9, 12:30 pm, Jon Kruger <[email protected]> wrote:
> > > > > > Here's the issue and the patch:
> > > > >http://code.google.com/p/fluent-nhibernate/issues/detail?id=183
> >
> > > > > > On Apr 9, 11:25 am, Jon Kruger <[email protected]> wrote:
> >
> > > > > > > I found the problem and fixed it... I'm creating an issue and
> > > > > > > submitting a patch, but I'm getting server errors right now.
> I'll
> > > try
> > > > > > > again after lunch.
> >
> > > > > > > On Apr 9, 10:31 am, Jon Kruger <[email protected]> wrote:
> >
> > > > > > > > I'm using auto-mapping and I'm also using
> > > > > ISessionSource.BuildSchema()
> > > > > > > > to create my database tables for me. I have audit fields in
> all
> > > my
> > > > > > > > tables (e.g. CreatedBy, CreatedDate, etc.), and I want these
> to
> > > be
> > > > > the
> > > > > > > > lastcolumnsin every table (currently they're sprinkled all
> over
> > > the
> > > > > > > > place in the table). Is there a way I can specify an order
> for
> > > the
> > > > > > > >columns?- Hide quoted text -
> >
> > > > - Show quoted text -
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---