http://jira.mfd.msk:8088/browse/CLS-427 реализация методов в transactional Imdg
This commit is contained in:
parent
658810cc85
commit
07293ff3eb
1 changed files with 23 additions and 0 deletions
|
|
@ -91,6 +91,29 @@ public class ImdgTransactionalHazelcast<T extends SpcexObjectBase> implements Im
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T getFirstObjectBySQL(String paramString) {
|
||||||
|
SqlPredicate sqlPredicate = new SqlPredicate(paramString);
|
||||||
|
Set<Long> found = map.keySet(sqlPredicate);
|
||||||
|
Iterator<Long> allFoundByCondition = found.iterator();
|
||||||
|
if (allFoundByCondition.hasNext()) {
|
||||||
|
return map.get(allFoundByCondition.next());
|
||||||
|
} else return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T getSingleObjectBySQL(String paramString) {
|
||||||
|
SqlPredicate sqlPredicate = new SqlPredicate(paramString);
|
||||||
|
Set<Long> found = map.keySet(sqlPredicate);
|
||||||
|
if (found.size() > 1) {
|
||||||
|
throw new RuntimeException("More than one element found by predicate " + paramString + " - " + found.size());
|
||||||
|
}
|
||||||
|
Iterator<Long> allFoundByCondition = found.iterator();
|
||||||
|
if (allFoundByCondition.hasNext()) {
|
||||||
|
return map.get(allFoundByCondition.next());
|
||||||
|
} else return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<T> getCollectionObjectsBySQL(String paramString) {
|
public Collection<T> getCollectionObjectsBySQL(String paramString) {
|
||||||
SqlPredicate sqlPredicate = new SqlPredicate(paramString);
|
SqlPredicate sqlPredicate = new SqlPredicate(paramString);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue