Skip to content

Commit

Permalink
small improvement for shadow query with disjunction
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Oct 12, 2014
1 parent 258b93a commit b01dab8
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -88,7 +88,6 @@ public boolean match(ObjectQuery objectQuery, Class<? extends ObjectType> type,
if (!ShadowType.class.equals(type)) {
return false;
}
LOGGER.info("shadow disjunction query match");
return parse(objectQuery) != null;
}

Expand Down Expand Up @@ -125,6 +124,11 @@ private ParsedQuery parse(ObjectQuery objectQuery) {
EqualFilter eqUidFilter = null;
EqualFilter eqNameFilter = null;
// ItemPath uidPath = new ItemPath(ShadowType.F_ATTRIBUTES, SchemaConstantsGenerated.ICF_S_UID);
if (orFilter.getConditions() != null && !orFilter.getConditions().isEmpty()){
if (orFilter.getConditions().size() != 2){
return null;
}
}
ItemPath namePath = new ItemPath(ShadowType.F_ATTRIBUTES, SchemaConstantsGenerated.ICF_S_NAME);
for (ObjectFilter filter : orFilter.getConditions()) {
if (!(filter instanceof EqualFilter)) {
Expand Down Expand Up @@ -160,7 +164,6 @@ public RQuery createQuery(ObjectQuery objectQuery, Class<? extends ObjectType> t
Collection<SelectorOptions<GetOperationOptions>> options, boolean countingObjects,
Session session) {

LOGGER.info("create shadow disjunction query");
DetachedCriteria c1 = DetachedCriteria.forClass(ClassMapper.getHQLTypeClass(ShadowType.class), "s");
c1.createCriteria("strings", "s1", JoinType.LEFT_OUTER_JOIN);

Expand Down

0 comments on commit b01dab8

Please sign in to comment.