I have this self referencing object, category.cfc
property name=“categoryId” generator=“identity” fieldtype=“id”;
property name=“parent” column=“parentId” fieldtype=“many-to-one” CFC=“category” fkcolumn=“parentId” cascade=“delete”;
property name=“lft” column=“leftId” type=“numeric”;
property name=“rgt” column=“rightId” type=“numeric”;
property name=“name” ormtype=“string” length=“255”;
property name=“description” ormtype=“text”;
If I try to remove a parent
var removed = ormService.deleteById( rc.categoryId );
I got:
Application Execution ExceptionError Type: org.hibernate.exception.ConstraintViolationException : 1451
Error Messages: could not execute update query
How can I set cascade to null to all child elements?