Hi,
I've the following entities relation, a Person has many Addresses:
Code:
public class Person{
private String name;
private Set<Address> addresses;
...
Code:
public class Address{
private Person person;
private String street;
private String city;
...
Now, I would like to do a bulk delete of Person entities having name containing 'titi'. I would writte a query similar to this one:
Code:
...
StringBuffer hql = new StringBuffer("delete from Person person where person.name like '%?%' ");
When the query will be executed, there will be parent FK violation has there are still addresses.
Question:
Do you know how (or if possible) I can remove in one statement (at least from hql) the person and related relations?