On 3/25/06, Emmanuel Bernard <[EMAIL PROTECTED]> wrote:
> I must admit I'm having hard time understanding the usefulness of it.
> Overriding a physical mapping seems reasonable, but overriding a logical
> mapping seems really weird.
> That's like changing a @OneToMany into a @ManyToMany by overriding: I
> don't get the point.

The reason I'm doing this is that I'm mapping a class structure that I
have limited control over.  We have a few re-used classes that are
basically structs, eg:

class Price {
  BigDecimal costExGst;
  BigDecimal listExGst;
  BigDecimal quoteExGst;
  BigDecimal costGst;
  BigDecimal listGst;
  BigDecimal quoteGst;
}

Typically all those fields are used, but the person that put this
together also used the same class for gst-free usages.  In that case
we only use the exGst properties, and in the database only have
columns for the exGst properties.  We use this Price class as an
embedded property across a whole range of uses, most of which use all
of its properties, but in some cases I only want to map the exGst
properties, eg:

class GstFreeLineItem {
  String lineItem;
  int quantity;
  @TransientOverrides([EMAIL PROTECTED](name="costGst",
transient=true), ....})
  Price priceEach;
}

Does that explain it a little better?

I know the correct answer here is "you're trying to map an illogical
class structure, go back and redesign it", but unfortunately I don't
have that luxury.

cheers
dim


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to