public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
{
Set<String> names = new HashSet<String>();
HibernateEntityManager em = getHibernateEntityManager(ctx);
checkControls(controls);
PageSearchControl pageSearchControl = null;
SortByNameSearchControl sortSearchControl = null;
AttributeFilterSearchControl attributeFilterControl = null;
NameFilterSearchControl nameFilterSearchControl = null;
if (controls != null)
{
for (IdentityObjectSearchControl control : controls)
{
if (control instanceof PageSearchControl)
{
pageSearchControl = (PageSearchControl)control;
}
else if (control instanceof SortByNameSearchControl)
{
sortSearchControl = (SortByNameSearchControl)control;
}
else if (control instanceof AttributeFilterSearchControl)
{
attributeFilterControl = (AttributeFilterSearchControl)control;
}
else if (control instanceof NameFilterSearchControl)
{
nameFilterSearchControl = (NameFilterSearchControl)control;
}
}
}
try
{
Query q = null;
if (sortSearchControl != null)
{
if (sortSearchControl.isAscending())
{
q = em.createNamedQuery("findIdentityObjectRelationshipNamesOrderedByNameAsc");
}
else
{
q = em.createNamedQuery("findIdentityObjectRelationshipNamesOrderedByNameDesc");
}
}
else
{
q = em.createNamedQuery("findIdentityObjectRelationshipNames");
}
q.setParameter("realm", getRealm(em, ctx));
if (nameFilterSearchControl != null)