I get this exception on startup:
Code:
org.hibernate.MappingException: No discriminator found for com.be.desktopbeautifier.server.DefaultTheme. Discriminator is needed when 'single-table-per-hiearchy' is used and a class has subclasses
Here is my mapping file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping
>
<class
name="com.be.desktopbeautifier.server.AbstractTheme"
table="theme"
discriminator-value="AbstractTheme"
>
<id
name="id"
column="id"
type="int"
unsaved-value="0"
>
<generator class="native">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-AbstractTheme.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>
<version
name="version"
column="version"
type="int"
/>
<set
name="children"
lazy="false"
cascade="all"
sort="unsorted"
>
<key
>
<column
name="parent_id"
not-null="true"
/>
</key>
<one-to-many
class="com.be.desktopbeautifier.server.AbstractTheme"
/>
</set>
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
column="name"
not-null="true"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-AbstractTheme.xml
containing the additional properties and place it in your merge dir.
-->
<subclass
name="com.be.desktopbeautifier.server.DefaultTheme"
discriminator-value="DefaultTheme"
>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-DefaultTheme.xml
containing the additional properties and place it in your merge dir.
-->
</subclass>
</class>
</hibernate-mapping>
Clearly "discriminator-value" is specified. Any ideas why this does not work?
Thank you,
Gili