001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.messageboards.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     */
023    public class MBMessageFinderUtil {
024            public static int countByC_T(java.util.Date createDate, long threadId)
025                    throws com.liferay.portal.kernel.exception.SystemException {
026                    return getFinder().countByC_T(createDate, threadId);
027            }
028    
029            public static int countByG_U_C_S(long groupId, long userId,
030                    long[] categoryIds, int status)
031                    throws com.liferay.portal.kernel.exception.SystemException {
032                    return getFinder().countByG_U_C_S(groupId, userId, categoryIds, status);
033            }
034    
035            public static int countByG_U_C_A_S(long groupId, long userId,
036                    long[] categoryIds, boolean anonymous, int status)
037                    throws com.liferay.portal.kernel.exception.SystemException {
038                    return getFinder()
039                                       .countByG_U_C_A_S(groupId, userId, categoryIds, anonymous,
040                            status);
041            }
042    
043            public static int filterCountByG_U_C_S(long groupId, long userId,
044                    long[] categoryIds, int status)
045                    throws com.liferay.portal.kernel.exception.SystemException {
046                    return getFinder()
047                                       .filterCountByG_U_C_S(groupId, userId, categoryIds, status);
048            }
049    
050            public static int filterCountByG_U_C_A_S(long groupId, long userId,
051                    long[] categoryIds, boolean anonymous, int status)
052                    throws com.liferay.portal.kernel.exception.SystemException {
053                    return getFinder()
054                                       .filterCountByG_U_C_A_S(groupId, userId, categoryIds,
055                            anonymous, status);
056            }
057    
058            public static java.util.List<java.lang.Long> filterFindByG_U_C_S(
059                    long groupId, long userId, long[] categoryIds, int status, int start,
060                    int end) throws com.liferay.portal.kernel.exception.SystemException {
061                    return getFinder()
062                                       .filterFindByG_U_C_S(groupId, userId, categoryIds, status,
063                            start, end);
064            }
065    
066            public static java.util.List<java.lang.Long> filterFindByG_U_C_A_S(
067                    long groupId, long userId, long[] categoryIds, boolean anonymous,
068                    int status, int start, int end)
069                    throws com.liferay.portal.kernel.exception.SystemException {
070                    return getFinder()
071                                       .filterFindByG_U_C_A_S(groupId, userId, categoryIds,
072                            anonymous, status, start, end);
073            }
074    
075            public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByNoAssets()
076                    throws com.liferay.portal.kernel.exception.SystemException {
077                    return getFinder().findByNoAssets();
078            }
079    
080            public static java.util.List<java.lang.Long> findByG_U_C_S(long groupId,
081                    long userId, long[] categoryIds, int status, int start, int end)
082                    throws com.liferay.portal.kernel.exception.SystemException {
083                    return getFinder()
084                                       .findByG_U_C_S(groupId, userId, categoryIds, status, start,
085                            end);
086            }
087    
088            public static java.util.List<java.lang.Long> findByG_U_C_A_S(long groupId,
089                    long userId, long[] categoryIds, boolean anonymous, int status,
090                    int start, int end)
091                    throws com.liferay.portal.kernel.exception.SystemException {
092                    return getFinder()
093                                       .findByG_U_C_A_S(groupId, userId, categoryIds, anonymous,
094                            status, start, end);
095            }
096    
097            public static MBMessageFinder getFinder() {
098                    if (_finder == null) {
099                            _finder = (MBMessageFinder)PortalBeanLocatorUtil.locate(MBMessageFinder.class.getName());
100    
101                            ReferenceRegistry.registerReference(MBMessageFinderUtil.class,
102                                    "_finder");
103                    }
104    
105                    return _finder;
106            }
107    
108            public void setFinder(MBMessageFinder finder) {
109                    _finder = finder;
110    
111                    ReferenceRegistry.registerReference(MBMessageFinderUtil.class, "_finder");
112            }
113    
114            private static MBMessageFinder _finder;
115    }