Using Hibernate 3.2.x.
I would like to map a range of coumns from a single table into a single primitive array value in a persistent class.
Table
time_series
id bigint,
value1 bigint,
value2 bigint,
value3 bigint,
...
value50 bigint
Persistent Class
Code:
public class TimeSeries {
print long id;
private long[] values;
...
}
I would like to devise a custom mapping that does not require me to enumerate all 50 column names in the mapping file. Instead, I would like to specify a column name pattern, and a length; e.g.
Code:
<hibernate-mapping>
<class name="TimeSeries"
table="time_series">
<id name="id">
<generator class="native"/>
</id>
<property name="values">
<type name="MyCustomType">
<param name="columnNameBase"> value</param>
<param name="columnCount"> 50</param>
</type>
</property>
...
But the UserType /CompositeUserType interfaces seem to assume that the column names are hardwired in the mapping document.
What interfaces/mechanisms are available to me to control the generation of mapped column names at runtime?
thanks for any pointers.
Joe