workaround for hibernate session's saveOrUpdate behaviour