Hibernate version: 3.2.3
I would like to create a user type to replace the following block of mapping scripts scattered in my mapping files:
<component update="true" insert="true" optimistic-lock="false" name="name" class="com.infor.gf.core.domain.ContextLocalisationDictionary">
<property name="maxStringLength" type="java.lang.Integer" access="field" column="c_Max_Name_Length"/>
<property name="contextId" type="java.lang.String" access="field" column="c_Context_Id_Name"/>
<property name="defaultValue" type="java.lang.String" column="c_Default_Value"/>
<!-- List<ContextLocaleValueForHibernate> contextLocaleValuesForHibernate -->
<list name="contextLocaleValuesForHibernate" table="coaChartOfAccounts_Name_Values" lazy="false" cascade="all">
<key column="c_ChartOfAccounts_Id"/>
<list-index column="c_Index"/>
<composite-element class="com.infor.gf.core.domain.ContextLocaleValueForHibernate">
<property name="contextId" unique-key="all" column="c_Context" type="java.lang.String" not-null="true" access="field"/>
<property name="locale" unique-key="all" column="c_Locale" type="java.util.Locale" not-null="true" access="field"/>
<property name="value" unique-key="all" column="c_Value" type="java.lang.String" length="75" not-null="true" access="field"/>
</composite-element>
</list>
</component>
I wonder if it is possible to make a class implements, for example, CompositeUserType to do such work? Could anyone help me?
Thanks
|