Author: bdaw
Date: 2012-02-17 07:11:44 -0500 (Fri, 17 Feb 2012)
New Revision: 1405
Modified:
idm/trunk/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
Log:
PLIDM-35 HibernateIdentityStoreImpl.prepareIdentityObjectQuery doesn't check for realm
in query
Modified:
idm/trunk/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
---
idm/trunk/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2012-02-16
21:28:54 UTC (rev 1404)
+++
idm/trunk/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2012-02-17
12:11:44 UTC (rev 1405)
@@ -914,6 +914,7 @@
//TODO:test
HibernateIdentityObject hibernateObject = safeGet(ctx, identity);
+ HibernateRealm realm = getRealm(getHibernateSession(ctx),ctx);
boolean orderByName = false;
boolean ascending = true;
@@ -948,6 +949,8 @@
hqlString.append("select distinct ior.toIdentityObject from
HibernateIdentityObjectRelationship ior where ");
}
+ hqlString.append("ior.toIdentityObject.realm = :realm and
ior.fromIdentityObject.realm = :realm and ");
+
if (relationshipType != null)
{
@@ -991,6 +994,9 @@
hqlString.append("select distinct ior.fromIdentityObject from
HibernateIdentityObjectRelationship ior where ");
}
+ hqlString.append("ior.toIdentityObject.realm = :realm and
ior.fromIdentityObject.realm = :realm and ");
+
+
if (relationshipType != null)
{
hqlString.append("ior.fromIdentityObject.name like :nameFilter and
ior.type.name = :relType and ior.toIdentityObject = :identity");
@@ -1023,7 +1029,8 @@
q = getHibernateSession(ctx).createQuery(hqlString.toString())
- .setParameter("identity",hibernateObject).setCacheable(true);
+ .setParameter("identity",hibernateObject)
+ .setParameter("realm",realm).setCacheable(true);
if (relationshipType != null)
{
Show replies by date