List of usage examples for com.liferay.portal.kernel.util StringPool CLOSE_PARENTHESIS
String CLOSE_PARENTHESIS
To view the source code for com.liferay.portal.kernel.util StringPool CLOSE_PARENTHESIS.
Click Source Link
From source file:com.liferay.ams.service.persistence.impl.TypePersistenceImpl.java
License:Open Source License
@Override public Map<Serializable, Type> fetchByPrimaryKeys(Set<Serializable> primaryKeys) { if (primaryKeys.isEmpty()) { return Collections.emptyMap(); }//from ww w .j a va 2 s. c o m Map<Serializable, Type> map = new HashMap<Serializable, Type>(); if (primaryKeys.size() == 1) { Iterator<Serializable> iterator = primaryKeys.iterator(); Serializable primaryKey = iterator.next(); Type type = fetchByPrimaryKey(primaryKey); if (type != null) { map.put(primaryKey, type); } return map; } Set<Serializable> uncachedPrimaryKeys = null; for (Serializable primaryKey : primaryKeys) { Type type = (Type) EntityCacheUtil.getResult(TypeModelImpl.ENTITY_CACHE_ENABLED, TypeImpl.class, primaryKey); if (type == null) { if (uncachedPrimaryKeys == null) { uncachedPrimaryKeys = new HashSet<Serializable>(); } uncachedPrimaryKeys.add(primaryKey); } else { map.put(primaryKey, type); } } if (uncachedPrimaryKeys == null) { return map; } StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1); query.append(_SQL_SELECT_TYPE_WHERE_PKS_IN); for (Serializable primaryKey : uncachedPrimaryKeys) { query.append(String.valueOf(primaryKey)); query.append(StringPool.COMMA); } query.setIndex(query.index() - 1); query.append(StringPool.CLOSE_PARENTHESIS); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); for (Type type : (List<Type>) q.list()) { map.put(type.getPrimaryKeyObj(), type); cacheResult(type); uncachedPrimaryKeys.remove(type.getPrimaryKeyObj()); } for (Serializable primaryKey : uncachedPrimaryKeys) { EntityCacheUtil.putResult(TypeModelImpl.ENTITY_CACHE_ENABLED, TypeImpl.class, primaryKey, _nullType); } } catch (Exception e) { throw processException(e); } finally { closeSession(session); } return map; }
From source file:com.liferay.bbb.service.persistence.impl.BBBMeetingPersistenceImpl.java
License:Open Source License
@Override public Map<Serializable, BBBMeeting> fetchByPrimaryKeys(Set<Serializable> primaryKeys) { if (primaryKeys.isEmpty()) { return Collections.emptyMap(); }/*from www. j a v a2s . c om*/ Map<Serializable, BBBMeeting> map = new HashMap<Serializable, BBBMeeting>(); if (primaryKeys.size() == 1) { Iterator<Serializable> iterator = primaryKeys.iterator(); Serializable primaryKey = iterator.next(); BBBMeeting bbbMeeting = fetchByPrimaryKey(primaryKey); if (bbbMeeting != null) { map.put(primaryKey, bbbMeeting); } return map; } Set<Serializable> uncachedPrimaryKeys = null; for (Serializable primaryKey : primaryKeys) { BBBMeeting bbbMeeting = (BBBMeeting) EntityCacheUtil.getResult(BBBMeetingModelImpl.ENTITY_CACHE_ENABLED, BBBMeetingImpl.class, primaryKey); if (bbbMeeting == null) { if (uncachedPrimaryKeys == null) { uncachedPrimaryKeys = new HashSet<Serializable>(); } uncachedPrimaryKeys.add(primaryKey); } else { map.put(primaryKey, bbbMeeting); } } if (uncachedPrimaryKeys == null) { return map; } StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1); query.append(_SQL_SELECT_BBBMEETING_WHERE_PKS_IN); for (Serializable primaryKey : uncachedPrimaryKeys) { query.append(String.valueOf(primaryKey)); query.append(StringPool.COMMA); } query.setIndex(query.index() - 1); query.append(StringPool.CLOSE_PARENTHESIS); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); for (BBBMeeting bbbMeeting : (List<BBBMeeting>) q.list()) { map.put(bbbMeeting.getPrimaryKeyObj(), bbbMeeting); cacheResult(bbbMeeting); uncachedPrimaryKeys.remove(bbbMeeting.getPrimaryKeyObj()); } for (Serializable primaryKey : uncachedPrimaryKeys) { EntityCacheUtil.putResult(BBBMeetingModelImpl.ENTITY_CACHE_ENABLED, BBBMeetingImpl.class, primaryKey, _nullBBBMeeting); } } catch (Exception e) { throw processException(e); } finally { closeSession(session); } return map; }
From source file:com.liferay.bbb.service.persistence.impl.BBBParticipantPersistenceImpl.java
License:Open Source License
@Override public Map<Serializable, BBBParticipant> fetchByPrimaryKeys(Set<Serializable> primaryKeys) { if (primaryKeys.isEmpty()) { return Collections.emptyMap(); }/*from ww w . j a v a 2 s . c o m*/ Map<Serializable, BBBParticipant> map = new HashMap<Serializable, BBBParticipant>(); if (primaryKeys.size() == 1) { Iterator<Serializable> iterator = primaryKeys.iterator(); Serializable primaryKey = iterator.next(); BBBParticipant bbbParticipant = fetchByPrimaryKey(primaryKey); if (bbbParticipant != null) { map.put(primaryKey, bbbParticipant); } return map; } Set<Serializable> uncachedPrimaryKeys = null; for (Serializable primaryKey : primaryKeys) { BBBParticipant bbbParticipant = (BBBParticipant) EntityCacheUtil .getResult(BBBParticipantModelImpl.ENTITY_CACHE_ENABLED, BBBParticipantImpl.class, primaryKey); if (bbbParticipant == null) { if (uncachedPrimaryKeys == null) { uncachedPrimaryKeys = new HashSet<Serializable>(); } uncachedPrimaryKeys.add(primaryKey); } else { map.put(primaryKey, bbbParticipant); } } if (uncachedPrimaryKeys == null) { return map; } StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1); query.append(_SQL_SELECT_BBBPARTICIPANT_WHERE_PKS_IN); for (Serializable primaryKey : uncachedPrimaryKeys) { query.append(String.valueOf(primaryKey)); query.append(StringPool.COMMA); } query.setIndex(query.index() - 1); query.append(StringPool.CLOSE_PARENTHESIS); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); for (BBBParticipant bbbParticipant : (List<BBBParticipant>) q.list()) { map.put(bbbParticipant.getPrimaryKeyObj(), bbbParticipant); cacheResult(bbbParticipant); uncachedPrimaryKeys.remove(bbbParticipant.getPrimaryKeyObj()); } for (Serializable primaryKey : uncachedPrimaryKeys) { EntityCacheUtil.putResult(BBBParticipantModelImpl.ENTITY_CACHE_ENABLED, BBBParticipantImpl.class, primaryKey, _nullBBBParticipant); } } catch (Exception e) { throw processException(e); } finally { closeSession(session); } return map; }
From source file:com.liferay.bbb.service.persistence.impl.BBBServerPersistenceImpl.java
License:Open Source License
@Override public Map<Serializable, BBBServer> fetchByPrimaryKeys(Set<Serializable> primaryKeys) { if (primaryKeys.isEmpty()) { return Collections.emptyMap(); }/* w ww. j a va 2s . c om*/ Map<Serializable, BBBServer> map = new HashMap<Serializable, BBBServer>(); if (primaryKeys.size() == 1) { Iterator<Serializable> iterator = primaryKeys.iterator(); Serializable primaryKey = iterator.next(); BBBServer bbbServer = fetchByPrimaryKey(primaryKey); if (bbbServer != null) { map.put(primaryKey, bbbServer); } return map; } Set<Serializable> uncachedPrimaryKeys = null; for (Serializable primaryKey : primaryKeys) { BBBServer bbbServer = (BBBServer) EntityCacheUtil.getResult(BBBServerModelImpl.ENTITY_CACHE_ENABLED, BBBServerImpl.class, primaryKey); if (bbbServer == null) { if (uncachedPrimaryKeys == null) { uncachedPrimaryKeys = new HashSet<Serializable>(); } uncachedPrimaryKeys.add(primaryKey); } else { map.put(primaryKey, bbbServer); } } if (uncachedPrimaryKeys == null) { return map; } StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1); query.append(_SQL_SELECT_BBBSERVER_WHERE_PKS_IN); for (Serializable primaryKey : uncachedPrimaryKeys) { query.append(String.valueOf(primaryKey)); query.append(StringPool.COMMA); } query.setIndex(query.index() - 1); query.append(StringPool.CLOSE_PARENTHESIS); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); for (BBBServer bbbServer : (List<BBBServer>) q.list()) { map.put(bbbServer.getPrimaryKeyObj(), bbbServer); cacheResult(bbbServer); uncachedPrimaryKeys.remove(bbbServer.getPrimaryKeyObj()); } for (Serializable primaryKey : uncachedPrimaryKeys) { EntityCacheUtil.putResult(BBBServerModelImpl.ENTITY_CACHE_ENABLED, BBBServerImpl.class, primaryKey, _nullBBBServer); } } catch (Exception e) { throw processException(e); } finally { closeSession(session); } return map; }
From source file:com.liferay.book.service.persistence.impl.BookPersistenceImpl.java
License:Open Source License
@Override public Map<Serializable, Book> fetchByPrimaryKeys(Set<Serializable> primaryKeys) { if (primaryKeys.isEmpty()) { return Collections.emptyMap(); }//from ww w . j a v a2 s . c o m Map<Serializable, Book> map = new HashMap<Serializable, Book>(); if (primaryKeys.size() == 1) { Iterator<Serializable> iterator = primaryKeys.iterator(); Serializable primaryKey = iterator.next(); Book book = fetchByPrimaryKey(primaryKey); if (book != null) { map.put(primaryKey, book); } return map; } Set<Serializable> uncachedPrimaryKeys = null; for (Serializable primaryKey : primaryKeys) { Serializable serializable = entityCache.getResult(BookModelImpl.ENTITY_CACHE_ENABLED, BookImpl.class, primaryKey); if (serializable != nullModel) { if (serializable == null) { if (uncachedPrimaryKeys == null) { uncachedPrimaryKeys = new HashSet<Serializable>(); } uncachedPrimaryKeys.add(primaryKey); } else { map.put(primaryKey, (Book) serializable); } } } if (uncachedPrimaryKeys == null) { return map; } StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1); query.append(_SQL_SELECT_BOOK_WHERE_PKS_IN); for (Serializable primaryKey : uncachedPrimaryKeys) { query.append(String.valueOf(primaryKey)); query.append(StringPool.COMMA); } query.setIndex(query.index() - 1); query.append(StringPool.CLOSE_PARENTHESIS); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); for (Book book : (List<Book>) q.list()) { map.put(book.getPrimaryKeyObj(), book); cacheResult(book); uncachedPrimaryKeys.remove(book.getPrimaryKeyObj()); } for (Serializable primaryKey : uncachedPrimaryKeys) { entityCache.putResult(BookModelImpl.ENTITY_CACHE_ENABLED, BookImpl.class, primaryKey, nullModel); } } catch (Exception e) { throw processException(e); } finally { closeSession(session); } return map; }
From source file:com.liferay.bookmarks.service.persistence.impl.BookmarksEntryPersistenceImpl.java
License:Open Source License
/** * Returns an ordered range of all the bookmarks entries that the user has permission to view where groupId = ? and folderId = any ?. * * <p>//from w w w . j ava 2 s. c o m * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link BookmarksEntryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. * </p> * * @param groupId the group ID * @param folderIds the folder IDs * @param start the lower bound of the range of bookmarks entries * @param end the upper bound of the range of bookmarks entries (not inclusive) * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) * @return the ordered range of matching bookmarks entries that the user has permission to view */ @Override public List<BookmarksEntry> filterFindByG_F(long groupId, long[] folderIds, int start, int end, OrderByComparator<BookmarksEntry> orderByComparator) { if (!InlineSQLHelperUtil.isEnabled(groupId)) { return findByG_F(groupId, folderIds, start, end, orderByComparator); } if (folderIds == null) { folderIds = new long[0]; } else if (folderIds.length > 1) { folderIds = ArrayUtil.unique(folderIds); Arrays.sort(folderIds); } StringBundler query = new StringBundler(); query.append(_SQL_SELECT_BOOKMARKSENTRY_WHERE); query.append(_FINDER_COLUMN_G_F_GROUPID_2); if (folderIds.length > 0) { query.append(StringPool.OPEN_PARENTHESIS); query.append(_FINDER_COLUMN_G_F_FOLDERID_7); query.append(StringUtil.merge(folderIds)); query.append(StringPool.CLOSE_PARENTHESIS); query.append(StringPool.CLOSE_PARENTHESIS); } query.setStringAt(removeConjunction(query.stringAt(query.index() - 1)), query.index() - 1); if (orderByComparator != null) { appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { query.append(BookmarksEntryModelImpl.ORDER_BY_JPQL); } String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(), BookmarksEntry.class.getName(), _FILTER_ENTITY_TABLE_FILTER_PK_COLUMN, _FILTER_ENTITY_TABLE_FILTER_USERID_COLUMN, groupId); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); return (List<BookmarksEntry>) QueryUtil.list(q, getDialect(), start, end); } catch (Exception e) { throw processException(e); } finally { closeSession(session); } }
From source file:com.liferay.bookmarks.service.persistence.impl.BookmarksEntryPersistenceImpl.java
License:Open Source License
/** * Returns an ordered range of all the bookmarks entries where groupId = ? and folderId = ?, optionally using the finder cache. * * <p>//www . jav a 2 s . co m * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link BookmarksEntryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. * </p> * * @param groupId the group ID * @param folderId the folder ID * @param start the lower bound of the range of bookmarks entries * @param end the upper bound of the range of bookmarks entries (not inclusive) * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) * @param retrieveFromCache whether to retrieve from the finder cache * @return the ordered range of matching bookmarks entries */ @Override public List<BookmarksEntry> findByG_F(long groupId, long[] folderIds, int start, int end, OrderByComparator<BookmarksEntry> orderByComparator, boolean retrieveFromCache) { if (folderIds == null) { folderIds = new long[0]; } else if (folderIds.length > 1) { folderIds = ArrayUtil.unique(folderIds); Arrays.sort(folderIds); } if (folderIds.length == 1) { return findByG_F(groupId, folderIds[0], start, end, orderByComparator); } boolean pagination = true; Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { pagination = false; finderArgs = new Object[] { groupId, StringUtil.merge(folderIds) }; } else { finderArgs = new Object[] { groupId, StringUtil.merge(folderIds), start, end, orderByComparator }; } List<BookmarksEntry> list = null; if (retrieveFromCache) { list = (List<BookmarksEntry>) finderCache.getResult(FINDER_PATH_WITH_PAGINATION_FIND_BY_G_F, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (BookmarksEntry bookmarksEntry : list) { if ((groupId != bookmarksEntry.getGroupId()) || !ArrayUtil.contains(folderIds, bookmarksEntry.getFolderId())) { list = null; break; } } } } if (list == null) { StringBundler query = new StringBundler(); query.append(_SQL_SELECT_BOOKMARKSENTRY_WHERE); query.append(_FINDER_COLUMN_G_F_GROUPID_2); if (folderIds.length > 0) { query.append(StringPool.OPEN_PARENTHESIS); query.append(_FINDER_COLUMN_G_F_FOLDERID_7); query.append(StringUtil.merge(folderIds)); query.append(StringPool.CLOSE_PARENTHESIS); query.append(StringPool.CLOSE_PARENTHESIS); } query.setStringAt(removeConjunction(query.stringAt(query.index() - 1)), query.index() - 1); if (orderByComparator != null) { appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else if (pagination) { query.append(BookmarksEntryModelImpl.ORDER_BY_JPQL); } String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); if (!pagination) { list = (List<BookmarksEntry>) QueryUtil.list(q, getDialect(), start, end, false); Collections.sort(list); list = Collections.unmodifiableList(list); } else { list = (List<BookmarksEntry>) QueryUtil.list(q, getDialect(), start, end); } cacheResult(list); finderCache.putResult(FINDER_PATH_WITH_PAGINATION_FIND_BY_G_F, finderArgs, list); } catch (Exception e) { finderCache.removeResult(FINDER_PATH_WITH_PAGINATION_FIND_BY_G_F, finderArgs); throw processException(e); } finally { closeSession(session); } } return list; }
From source file:com.liferay.bookmarks.service.persistence.impl.BookmarksEntryPersistenceImpl.java
License:Open Source License
/** * Returns the number of bookmarks entries where groupId = ? and folderId = any ?. * * @param groupId the group ID/*from w ww . j av a2 s. c o m*/ * @param folderIds the folder IDs * @return the number of matching bookmarks entries */ @Override public int countByG_F(long groupId, long[] folderIds) { if (folderIds == null) { folderIds = new long[0]; } else if (folderIds.length > 1) { folderIds = ArrayUtil.unique(folderIds); Arrays.sort(folderIds); } Object[] finderArgs = new Object[] { groupId, StringUtil.merge(folderIds) }; Long count = (Long) finderCache.getResult(FINDER_PATH_WITH_PAGINATION_COUNT_BY_G_F, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(); query.append(_SQL_COUNT_BOOKMARKSENTRY_WHERE); query.append(_FINDER_COLUMN_G_F_GROUPID_2); if (folderIds.length > 0) { query.append(StringPool.OPEN_PARENTHESIS); query.append(_FINDER_COLUMN_G_F_FOLDERID_7); query.append(StringUtil.merge(folderIds)); query.append(StringPool.CLOSE_PARENTHESIS); query.append(StringPool.CLOSE_PARENTHESIS); } query.setStringAt(removeConjunction(query.stringAt(query.index() - 1)), query.index() - 1); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); count = (Long) q.uniqueResult(); finderCache.putResult(FINDER_PATH_WITH_PAGINATION_COUNT_BY_G_F, finderArgs, count); } catch (Exception e) { finderCache.removeResult(FINDER_PATH_WITH_PAGINATION_COUNT_BY_G_F, finderArgs); throw processException(e); } finally { closeSession(session); } } return count.intValue(); }
From source file:com.liferay.bookmarks.service.persistence.impl.BookmarksEntryPersistenceImpl.java
License:Open Source License
/** * Returns the number of bookmarks entries that the user has permission to view where groupId = ? and folderId = any ?. * * @param groupId the group ID//from w ww .j a v a 2 s . c o m * @param folderIds the folder IDs * @return the number of matching bookmarks entries that the user has permission to view */ @Override public int filterCountByG_F(long groupId, long[] folderIds) { if (!InlineSQLHelperUtil.isEnabled(groupId)) { return countByG_F(groupId, folderIds); } if (folderIds == null) { folderIds = new long[0]; } else if (folderIds.length > 1) { folderIds = ArrayUtil.unique(folderIds); Arrays.sort(folderIds); } StringBundler query = new StringBundler(); query.append(_SQL_COUNT_BOOKMARKSENTRY_WHERE); query.append(_FINDER_COLUMN_G_F_GROUPID_2); if (folderIds.length > 0) { query.append(StringPool.OPEN_PARENTHESIS); query.append(_FINDER_COLUMN_G_F_FOLDERID_7); query.append(StringUtil.merge(folderIds)); query.append(StringPool.CLOSE_PARENTHESIS); query.append(StringPool.CLOSE_PARENTHESIS); } query.setStringAt(removeConjunction(query.stringAt(query.index() - 1)), query.index() - 1); String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(), BookmarksEntry.class.getName(), _FILTER_ENTITY_TABLE_FILTER_PK_COLUMN, _FILTER_ENTITY_TABLE_FILTER_USERID_COLUMN, groupId); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); Long count = (Long) q.uniqueResult(); return count.intValue(); } catch (Exception e) { throw processException(e); } finally { closeSession(session); } }
From source file:com.liferay.bookmarks.service.persistence.impl.BookmarksEntryPersistenceImpl.java
License:Open Source License
/** * Returns an ordered range of all the bookmarks entries that the user has permission to view where groupId = ? and folderId = any ? and status = ?. * * <p>//w w w . j ava 2 s. com * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link BookmarksEntryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. * </p> * * @param groupId the group ID * @param folderIds the folder IDs * @param status the status * @param start the lower bound of the range of bookmarks entries * @param end the upper bound of the range of bookmarks entries (not inclusive) * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) * @return the ordered range of matching bookmarks entries that the user has permission to view */ @Override public List<BookmarksEntry> filterFindByG_F_S(long groupId, long[] folderIds, int status, int start, int end, OrderByComparator<BookmarksEntry> orderByComparator) { if (!InlineSQLHelperUtil.isEnabled(groupId)) { return findByG_F_S(groupId, folderIds, status, start, end, orderByComparator); } if (folderIds == null) { folderIds = new long[0]; } else if (folderIds.length > 1) { folderIds = ArrayUtil.unique(folderIds); Arrays.sort(folderIds); } StringBundler query = new StringBundler(); query.append(_SQL_SELECT_BOOKMARKSENTRY_WHERE); query.append(_FINDER_COLUMN_G_F_S_GROUPID_2); if (folderIds.length > 0) { query.append(StringPool.OPEN_PARENTHESIS); query.append(_FINDER_COLUMN_G_F_S_FOLDERID_7); query.append(StringUtil.merge(folderIds)); query.append(StringPool.CLOSE_PARENTHESIS); query.append(StringPool.CLOSE_PARENTHESIS); query.append(WHERE_AND); } query.append(_FINDER_COLUMN_G_F_S_STATUS_2); query.setStringAt(removeConjunction(query.stringAt(query.index() - 1)), query.index() - 1); if (orderByComparator != null) { appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { query.append(BookmarksEntryModelImpl.ORDER_BY_JPQL); } String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(), BookmarksEntry.class.getName(), _FILTER_ENTITY_TABLE_FILTER_PK_COLUMN, _FILTER_ENTITY_TABLE_FILTER_USERID_COLUMN, groupId); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); qPos.add(status); return (List<BookmarksEntry>) QueryUtil.list(q, getDialect(), start, end); } catch (Exception e) { throw processException(e); } finally { closeSession(session); } }