001    /**
002     * Copyright (c) 2000-2011 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.dynamicdatamapping.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 DDMStructureFinderUtil {
024            public static int countByKeywords(long companyId, long groupId,
025                    long[] classNameIds, java.lang.String keywords)
026                    throws com.liferay.portal.kernel.exception.SystemException {
027                    return getFinder()
028                                       .countByKeywords(companyId, groupId, classNameIds, keywords);
029            }
030    
031            public static int countByC_G_C_N_D_S(long companyId, long groupId,
032                    long[] classNameIds, java.lang.String name,
033                    java.lang.String description, java.lang.String storageType,
034                    boolean andOperator)
035                    throws com.liferay.portal.kernel.exception.SystemException {
036                    return getFinder()
037                                       .countByC_G_C_N_D_S(companyId, groupId, classNameIds, name,
038                            description, storageType, andOperator);
039            }
040    
041            public static int countByC_G_C_N_D_S(long companyId, long groupId,
042                    long[] classNameIds, java.lang.String[] names,
043                    java.lang.String[] descriptions, java.lang.String[] storageTypes,
044                    boolean andOperator)
045                    throws com.liferay.portal.kernel.exception.SystemException {
046                    return getFinder()
047                                       .countByC_G_C_N_D_S(companyId, groupId, classNameIds, names,
048                            descriptions, storageTypes, andOperator);
049            }
050    
051            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> findByKeywords(
052                    long companyId, long groupId, long[] classNameIds,
053                    java.lang.String keywords, int start, int end,
054                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
055                    throws com.liferay.portal.kernel.exception.SystemException {
056                    return getFinder()
057                                       .findByKeywords(companyId, groupId, classNameIds, keywords,
058                            start, end, orderByComparator);
059            }
060    
061            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> findByC_G_C_N_D_S(
062                    long companyId, long groupId, long[] classNameIds,
063                    java.lang.String name, java.lang.String description,
064                    java.lang.String storageType, boolean andOperator, int start, int end,
065                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
066                    throws com.liferay.portal.kernel.exception.SystemException {
067                    return getFinder()
068                                       .findByC_G_C_N_D_S(companyId, groupId, classNameIds, name,
069                            description, storageType, andOperator, start, end, orderByComparator);
070            }
071    
072            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> findByC_G_C_N_D_S(
073                    long companyId, long groupId, long[] classNameIds,
074                    java.lang.String[] names, java.lang.String[] descriptions,
075                    java.lang.String[] storageTypes, boolean andOperator, int start,
076                    int end,
077                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
078                    throws com.liferay.portal.kernel.exception.SystemException {
079                    return getFinder()
080                                       .findByC_G_C_N_D_S(companyId, groupId, classNameIds, names,
081                            descriptions, storageTypes, andOperator, start, end,
082                            orderByComparator);
083            }
084    
085            public static DDMStructureFinder getFinder() {
086                    if (_finder == null) {
087                            _finder = (DDMStructureFinder)PortalBeanLocatorUtil.locate(DDMStructureFinder.class.getName());
088    
089                            ReferenceRegistry.registerReference(DDMStructureFinderUtil.class,
090                                    "_finder");
091                    }
092    
093                    return _finder;
094            }
095    
096            public void setFinder(DDMStructureFinder finder) {
097                    _finder = finder;
098    
099                    ReferenceRegistry.registerReference(DDMStructureFinderUtil.class,
100                            "_finder");
101            }
102    
103            private static DDMStructureFinder _finder;
104    }