You can use @AttributeOverrides to map the fields in the embeddable to the same 
columns. 

-Fay


--- On Tue, 3/24/09, Adam Hardy <[email protected]> wrote:

> From: Adam Hardy <[email protected]>
> Subject: usage of embeddable
> To: [email protected]
> Date: Tuesday, March 24, 2009, 3:03 AM
> I have a requirement to display some
> price data using different formats according to its origin,
> i.e. decimal places vary, or are shown as fractions e.g. 129
> 21/32
> 
> My idea is to use 'embeddable' to persist a field of type
> MyBigDecimalWrapper which knows how to display itself, i.e.
> it has a BigDecimal and an enum specifying display type.
> 
> However I then realised I would need to have an extra
> column for every price column.
> 
> This seems like overkill, considering that some persistent
> entities might have five price fields and the display type
> is the same for each.
> 
> There is no way around this, is there, because I can't map
> a column more than once?
> 


      

Reply via email to