Thanks a lot, thats exactly what I was looking for.
On Jun 15, 1:06 am, Hudson Akridge <[email protected]> wrote:
> If it makes sense in your domain to, you should map Order and Shipment as
> part of the same class hierarchy, then you could do a
> .DiscriminateSubclassesOnColumn("STATUS")
> then Map Order to the "O" discriminator value, and shipment to the "C".
>
> If same class hierarchy isn't on the agenda for your domain, then you can
> use the "where" attribute on ClassMap. It's not strongly typed at the
> moment, you'll need to .SetAttribute("where","status='C');
>
> But at some point here shortly, once the SM stuff has changed behind the
> scenes, you'll have a strong typed version of .Where() on the class (and
> SetAttribute() won't exist anymore)
>
>
>
>
>
> On Sun, Jun 14, 2009 at 9:50 PM, George Mauer <[email protected]> wrote:
>
> > Sorry about the questions (there will be many) but I'm new here.
>
> > I have a class Order and a class Shipment where a shipment is created
> > from an order when a user marks the order as completed. Although this
> > is likely to change, the Order and Shipment classes are not currently
> > part of the same inheritance hierarchy.
>
> > Although the concepts of a fulfilled and unfulfilled order are quite
> > separate the legacy database that I am working with stores information
> > on both in the same table called SHIPMENTS. The difference is that
> > for orders the SHIPMENTS.STATUS column is 'O' and for shipments the
> > SHIPMENTS.STATUS column is 'C'. In other words, if we are talking
> > about an order there always needs to be a WHERE status = 'O' clause
> > and if you're talking about a shipment then you will always need need
> > WHERE status = 'C'.
>
> > How do I specify this in my OrderMap mapping?
>
> > Thanks a lot,
> > George Mauer
>
> --
> - Hudsonhttp://www.bestguesstheory.comhttp://twitter.com/HudsonAkridge
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---