I'm trying to use Hibernate in conjunction with JAXB and Hibernate Synchronizer to persist my model to a MySql database.
According to the doc: " It is perfectly acceptable for the named persistent class to be an interface. You would then declare implementing classes of that interface using the <subclass> element."
And here is the mapping:
Code:
<hibernate-mapping>
<class name="User" table="users">
<id name="id" type="integer" column="PK_ID">
<generator class="native"/>
</id>
<discriminator type="string" force="true"/>
<subclass name="UserImpl" discriminator-value="not null" dynamic-update="true">
<property name="name" type="string" column="NAME"/>
<property name="password" type="string" column="PASSWORD"/>
</subclass>
</class>
</hibernate-mapping>
I've played with various combinations of "discriminator" and "discriminator-value" attributes without success. Using this version of the mapping gives me a "The session factory has not been initialized." error.
Does this mapping look ok to you? Is it possible that the Synchronizer generated code to be wrong? Do you guys have any suggestions?
Thanks,
Ovi