Hi,
When I create List collection in hibernate, I want to use the oracle ROWNUM as the index column. But if i give the column name as ROWNUM, I get a database exception as the ROWNUM is not a physical column (as hibernate appends the columns names with table alias ).
So I made a change to the DTD as below
<!ELEMENT list-index ((column|formula)?)> <!ATTLIST list-index column CDATA #IMPLIED> <!ATTLIST list-index formula CDATA #IMPLIED> <!ATTLIST list-index base CDATA "0">
and used 'formula' instead of column and it works perfectly fine. Is there a better workaround
My mapping information is below
<list name="currentDetailDVOs" table="HR_SCENARIO_INFO" inverse="true" lazy="false" cascade="merge">
<key column="CLASS_INFO_ID"/>
<list-index formula="ROWNUM" base="1"/>
<one-to-many class="com.classified.dvo.ModuleDetailDVO" />
</list>
Lakshmanan
|