hari_sujathan wrote:
Can I say in hbm2ddl that not to generate constraint for this many-to-on relation?
I don't think so. Besides, you almost certainly don't want to do this. You shouldn't just delete something that other things have a reference to. Calin's suggestion is the usual solution, but alternatives are possible. For example, you could use a link table, and make the mapping a many-to-many unique="true" (thus making it effectively a many-to-one mapping): you can set up that mappnig so that deleting either side of the association deletes any entries in the link table but not the object on the other side of the association. This solution is described in the ref docs, sections 7.3.1 and 7.3.2 (not that there's a typo in some older revisions of that doc: replace <join>s with <set>).