openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID (ATTSI)" <dk0...@att.com>
Subject Map enum with AbstractValueHandler, but on multiple columns
Date Thu, 03 Jun 2010 15:28:50 GMT
Using OpenJPA 1.2.2 (I can't upgrade to 2.0.0 at this time).

I have several columns in various tables that are mapped with enum
types, using an AbstractValueHandler strategy in each case.  In each of
those cases, the enum type is only used for that single column in that
table.

In my AbstractValueHandlers, I define the "map", "toObjectValue", and
"toDataStoreValue" methods.  The last two are simple.  In the "map"
method, I return an array of one Column object, specifying the column
name and type.  It seems odd to specify a column name here, but it
works.

I now have a situation where a particular enum type is going to be used
in several columns in several tables.  Am I going to have to make a list
of the column names in the various tables where this type is used and
return them from the "map" method?  That can't be right.  What are my
options for making this a little cleaner?

Mime
View raw message