You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Adam Hardy <ad...@cyberspaceroad.com> on 2009/03/24 11:03:07 UTC
usage of embeddable
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?