Hi,
I'm trying to use an Auxillary database-object, see,
http://docs.jboss.org/hibernate/core/3. ... ase-object to alter some foreign keys, however it is never executed (even if I implement my own). I've tried stepping through the code, & I can see the mapping file is read, but there is nothing that runs the aux code.
Here is my setup:
Hibernate 3.3.2.GA
Hibernate Annotations 3.4.0.GA
Spring 3
Session Factory bean def:
Code:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
destroy-method="destroy" >
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties" ref="hibernateProperties" />
<property name="annotatedClasses" ref="annotatedClasses" />
<property name="mappingResources" value="Event.hbm.xml" />
</bean>
Event.hbm.xml
Code:
<hibernate-mapping>
<database-object>
<create>
alter table event drop constraint FK_ASSET;
alter table event add constraint FK_ASSET foreign key ('asset_id') references asset('id') on delete set null;
</create>
<drop></drop>
</database-object>
</hibernate-mapping>
Can anybody help please???
Thanks in advance,
Kevin.