001    /**
002     * Copyright (c) 2000-present 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.portal.kernel.dao.orm;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.search.Document;
019    import com.liferay.portal.kernel.transaction.TransactionAttribute;
020    import com.liferay.portal.service.BaseLocalService;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    public interface ActionableDynamicQuery {
026    
027            public void addDocument(Document document) throws PortalException;
028    
029            public AddCriteriaMethod getAddCriteriaMethod();
030    
031            public AddOrderCriteriaMethod getAddOrderCriteriaMethod();
032    
033            public PerformActionMethod<?> getPerformActionMethod();
034    
035            public PerformCountMethod getPerformCountMethod();
036    
037            public void performActions() throws PortalException;
038    
039            public long performCount() throws PortalException;
040    
041            public void setAddCriteriaMethod(AddCriteriaMethod addCriteriaMethod);
042    
043            public void setAddOrderCriteriaMethod(
044                    AddOrderCriteriaMethod addOrderCriteriaMethod);
045    
046            public void setBaseLocalService(BaseLocalService baseLocalService);
047    
048            public void setClass(Class<?> clazz);
049    
050            public void setClassLoader(ClassLoader classLoader);
051    
052            public void setCommitImmediately(boolean commitImmediately);
053    
054            public void setCompanyId(long companyId);
055    
056            public void setGroupId(long groupId);
057    
058            public void setGroupIdPropertyName(String groupIdPropertyName);
059    
060            public void setInterval(int interval);
061    
062            public void setParallel(boolean parallel);
063    
064            public void setPerformActionMethod(
065                    PerformActionMethod<?> performActionMethod);
066    
067            public void setPerformCountMethod(PerformCountMethod performCountMethod);
068    
069            public void setPrimaryKeyPropertyName(String primaryKeyPropertyName);
070    
071            public void setSearchEngineId(String searchEngineId);
072    
073            public void setTransactionAttribute(
074                    TransactionAttribute transactionAttribute);
075    
076            public interface AddCriteriaMethod {
077    
078                    public void addCriteria(DynamicQuery dynamicQuery);
079    
080            }
081    
082            public interface AddOrderCriteriaMethod {
083    
084                    public void addOrderCriteria(DynamicQuery dynamicQuery);
085    
086            }
087    
088            public interface PerformActionMethod<T> {
089    
090                    public void performAction(T t) throws PortalException;
091    
092            }
093    
094            public interface PerformCountMethod {
095    
096                    public long performCount() throws PortalException;
097    
098            }
099    
100    }