Hi,
It's been here a million times but always in a different flavour. I've got UserType interface implemented by UserTypeVO. Naturally I would like to map the interface rather than implementation.
I've mapped it kinda successful, but Hibernate forces me to supply a class disciminator, which I have not (there is no inheritance). Is there any way to overcome this?
All I want is the UserTypeVO to be returned in the queries that go on UserType
If don' specify the discriminator I get:
Quote:
org.hibernate.MappingException: No discriminator found for com.eblib.components.business.cemanager.impl.dao.UserTypeVO. Discriminator is needed when 'single-table-per-hiearchy' is used and a class has subclasses
Here's my mapping:
Code:
<hibernate-mapping>
<class name="com.eblib.components.business.cemanager.UserType" table="EBL_USER_TYPE" lazy="false" select-before-update="true">
<meta attribute="interface">true</meta>
<id name="id" column="USER_TYPE_ID" type="java.lang.Long" unsaved-value="null">
<generator class="hilo">
<param name="table">EBL_HIBERNATE_KEY</param>
<param name="column">NEXT_VALUE</param>
</generator>
</id>
<property name="acronym" type="java.lang.String" update="true" insert="true" column="ACRONYM" />
<property name="active" update="true" type="yes_no" insert="true" column="ACTIVE" />
<property name="guest" update="true" type="yes_no" insert="true" column="IS_GUEST" />
<property name="patronType" update="true" type="yes_no" insert="true" column="IS_PATRON_TYPE" />
<property name="name" type="java.lang.String" update="true" insert="true" column="NAME" />
<property name="system" type="java.lang.String" update="true" insert="true" column="SYSTEM" />
<subclass name="com.eblib.components.business.cemanager.impl.dao.UserTypeVO">
<meta attribute="implements">com.eblib.components.business.cemanager.UserType</meta>
</subclass>
</class>
</hibernate-mapping>
Many thanks
Maciej Mastalarczuk