HibernateRealm realm = getRealm(em, ctx);
try
{
HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)em.getSession().createCriteria(HibernateIdentityObjectRelationshipName.class)
.add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", realm)).uniqueResult();
if (hiorn != null)
{
throw new IdentityException("Relationship name already exists");
}
hiorn = new HibernateIdentityObjectRelationshipName(name, realm);
getHibernateEntityManager(ctx).persist(hiorn);
}
catch (Exception e)
{