0

I am generating schema using hibernate hbm2ddl feature.. while defining Realtionship between entities, I want to set ON DELETE SET NULL for child class. But hibernate does not allow us to define such constraint annotationally. I want to define this annotation. how to achieve this?

1 Answers1

1

Have a look at 5.6. Auxiliary Database Objects in the NHibernate reference. You can write an ALTER command tweak the constraint as needed.

Oskar Berggren
  • 5,583
  • 1
  • 19
  • 36
  • thanks for replying Oskar..! The link you have given seem to be helping for .NET framework.. But I am using Java annnotation. It would be better if u post some code so that i will map it with my needs.. awaiting reply... – Shreyas Deshpande Feb 27 '13 at 08:56
  • @ShreyasDeshpande if you are using Java Hibernate, why did you use NHibernate tags? Also, what Oskar wrote applies to Hibernate as well, see http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html_single/#mapping-database-object – Diego Mijelshon Feb 27 '13 at 15:54