List<WallEntry> list = (List<WallEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
finderArgs, this);
if (list == null) {
Session session = null;
try {
session = openSession();
StringBundler query = null;
String sql = null;
if (orderByComparator != null) {
query = new StringBundler(2 +
(orderByComparator.getOrderByFields().length * 3));
query.append(_SQL_SELECT_WALLENTRY);
appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
orderByComparator);
sql = query.toString();
}
else {
sql = _SQL_SELECT_WALLENTRY.concat(WallEntryModelImpl.ORDER_BY_JPQL);
}
Query q = session.createQuery(sql);
if (orderByComparator == null) {
list = (List<WallEntry>)QueryUtil.list(q, getDialect(),
start, end, false);