Code:
HibernateUtil.delete(this);
log.debug("ID:" + this.getId());
log.debug("Contains:" + getUser().getPhones().contains(this));
log.debug("Equals:" + getUser().getPhones().iterator().next()
.equals(this));
log.debug("Phone removed: " + getUser().getPhones().remove(this));
Code:
2004-04-14 17:33:50,388 DEBUG bl.DPUserPhoneHBImpl - ID:63
2004-04-14 17:33:50,388 DEBUG bl.DPUserPhoneHBImpl - Contains:false
2004-04-14 17:33:50,388 DEBUG bl.DPUserPhoneHBImpl - Equals:true
2004-04-14 17:33:50,388 DEBUG bl.DPUserPhoneHBImpl - Phone removed: false
Hibernate: delete from DP_USER_PHONES where ID=?
Code:
public static void delete(Object obj) throws HibernateException
{
try
{
Session session = HibernateUtil.currentSession();
session.delete(obj);
}
catch (HibernateException e)
{
throw e;
}
}
What's wrong? Why can't I remove object from the colection?
What must becode with object's ID after deleting object?[/code]