I am having a problem trying to create a valid mapping between two objects in my application.
My object, Account, has a current status of type LimitStatus, as well as a set of all the previous status's. I have tried to map this relationship however hibernate seems to freeze on startup. I have tried a number of different options but nothing seems to work. Additionally I have been asked not to use interceptor, so the History interceptor is not a valid option.
I would appreciate any help with this.
Hibernate version: 2.1.2
Mapping documents:
<class name="Account" lazy="true" dynamic-update="true">
<id name="id">
<generator class="native"/>
</id>
<version name="version"/>
<property name="accountCode">
<column name="accountCode" unique="true" length="15" not-null="true"/>
</property>
<property name="description" length="50"/>
<many-to-one name="currentStatus" class="LimitStatus" column="currentStatusId" cascade="none"/>
<set name="statusHistory" cascade="none" lazy="true" batch-size="10">
<key foreign-key="fk_account_limit" column="accountId"/>
<one-to-many class="LimitStatus"/>
</set>
</class>
<class name="LimitStatus" lazy ="true" dynamic-update="true">
<id name="id">
<generator class="native"/>
</id>
<version name="version"/>
<set name="assessedLimits" cascade="save-update" lazy="true" batch-size="10">
<key foreign-key="fk_status_limit" column="StatusId"/>
<one-to-many class="AssessedLimit"/>
</set>
</class>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
n/a
system hangs after Not binding factory to JNDI, no JNDI name configured
Name and version of the database you are using:
Ms SQL Server 2000
The generated SQL (show_sql=true):
does not get that far
Debug level Hibernate log excerpt:
|