Greetings!
I'm using the table-per-subclass mapping strategy using <joined-subclass>, and found that in one case, the parent and child table have a column with the same name.
Here's what the database looks like:
ParentDocument
-------
id
column1
ChildDocument
------
id
parentId
column2
I'm trying to get the child "id" field to use in a set mapping.
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.company.project.module.domain">
<joined-subclass name="ChildDocument" extends="com.company.project.module.domain.ParentDocument" dynamic-update="true" table="ChildDocument">
<key column="parentId" />
<set name="roles" table="DocumentRoles">
<key column="childDocumentId" property-ref="????" />
<many-to-many column="roleId" class="com.company.project.module.domain.Role" />
</set>
</joined-subclass>
</hibernate-mapping>
I've tried putting all the following in ????, but to no avail:
id
ChildDocument.id
Document0_1_.id (examined the produced SQL to get this)
{ChildDocument}.id
{ChildDocument.id}
Unfortunately, I don't have the ability to change column names or else I would have done that hours ago. I would appreciate any help, as I seem to have hit a wall :)
-- Corey