result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_SEQUENCINGID,
finderArgs, this);
}
if (result instanceof LFChildrenSelection) {
LFChildrenSelection lfChildrenSelection = (LFChildrenSelection) result;
if (!Validator.equals(sequencingID,
lfChildrenSelection.getSequencingID())) {
result = null;
}
}
if (result == null) {
StringBundler query = new StringBundler(3);
query.append(_SQL_SELECT_LFCHILDRENSELECTION_WHERE);
if (sequencingID == null) {
query.append(_FINDER_COLUMN_SEQUENCINGID_SEQUENCINGID_NULL_2);
} else {
query.append(_FINDER_COLUMN_SEQUENCINGID_SEQUENCINGID_2);
}
String sql = query.toString();
Session session = null;
try {
session = openSession();
Query q = session.createQuery(sql);
QueryPos qPos = QueryPos.getInstance(q);
if (sequencingID != null) {
qPos.add(sequencingID.intValue());
}
List<LFChildrenSelection> list = q.list();
if (list.isEmpty()) {
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_SEQUENCINGID,
finderArgs, list);
} else {
if ((list.size() > 1) && _log.isWarnEnabled()) {
_log.warn(
"LFChildrenSelectionPersistenceImpl.fetchBySequencingID(Integer, boolean) with parameters (" +
StringUtil.merge(finderArgs) +
") yields a result set with more than 1 result. This violates the logical unique restriction. There is no order guarantee on which result is returned by this finder.");
}
LFChildrenSelection lfChildrenSelection = list.get(0);
result = lfChildrenSelection;
cacheResult(lfChildrenSelection);
if ((lfChildrenSelection.getSequencingID() != sequencingID)) {
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_SEQUENCINGID,
finderArgs, lfChildrenSelection);
}
}
} catch (Exception e) {