result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_TINCANID,
finderArgs, this);
}
if (result instanceof LFTincanManifestAct) {
LFTincanManifestAct lfTincanManifestAct = (LFTincanManifestAct) result;
if (!Validator.equals(tincanID, lfTincanManifestAct.getTincanID())) {
result = null;
}
}
if (result == null) {
StringBundler query = new StringBundler(3);
query.append(_SQL_SELECT_LFTINCANMANIFESTACT_WHERE);
boolean bindTincanID = false;
if (tincanID == null) {
query.append(_FINDER_COLUMN_TINCANID_TINCANID_1);
} else if (tincanID.equals(StringPool.BLANK)) {
query.append(_FINDER_COLUMN_TINCANID_TINCANID_3);
} else {
bindTincanID = true;
if (tincanID.equals(StringPool.BLANK)) {
query.append(_FINDER_COLUMN_TINCANID_TINCANID_3);
} else {
query.append(_FINDER_COLUMN_TINCANID_TINCANID_2);
}
}
String sql = query.toString();
Session session = null;
try {
session = openSession();
Query q = session.createQuery(sql);
QueryPos qPos = QueryPos.getInstance(q);
if (bindTincanID) {
if (tincanID != null) {
qPos.add(tincanID);
}
}
List<LFTincanManifestAct> list = q.list();
if (list.isEmpty()) {
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_TINCANID,
finderArgs, list);
} else {
if ((list.size() > 1) && _log.isWarnEnabled()) {
_log.warn(
"LFTincanManifestActPersistenceImpl.fetchByTincanID(String, 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.");
}
LFTincanManifestAct lfTincanManifestAct = list.get(0);
result = lfTincanManifestAct;
cacheResult(lfTincanManifestAct);
if ((lfTincanManifestAct.getTincanID() == null) ||
!lfTincanManifestAct.getTincanID().equals(tincanID)) {
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_TINCANID,
finderArgs, lfTincanManifestAct);
}
}
} catch (Exception e) {