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.service.BaseLocalService;
019    import com.liferay.portal.kernel.transaction.TransactionConfig;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public interface ActionableDynamicQuery {
025    
026            public AddCriteriaMethod getAddCriteriaMethod();
027    
028            public AddOrderCriteriaMethod getAddOrderCriteriaMethod();
029    
030            public PerformActionMethod<?> getPerformActionMethod();
031    
032            public PerformCountMethod getPerformCountMethod();
033    
034            public boolean isParallel();
035    
036            public void performActions() throws PortalException;
037    
038            public long performCount() throws PortalException;
039    
040            public void setAddCriteriaMethod(AddCriteriaMethod addCriteriaMethod);
041    
042            public void setAddOrderCriteriaMethod(
043                    AddOrderCriteriaMethod addOrderCriteriaMethod);
044    
045            public void setBaseLocalService(BaseLocalService baseLocalService);
046    
047            /**
048             * @deprecated As of 7.0.0, replaced by {@link #setModelClass(Class)}
049             */
050            @Deprecated
051            public void setClass(Class<?> clazz);
052    
053            public void setClassLoader(ClassLoader classLoader);
054    
055            public void setCompanyId(long companyId);
056    
057            public void setGroupId(long groupId);
058    
059            public void setGroupIdPropertyName(String groupIdPropertyName);
060    
061            public void setInterval(int interval);
062    
063            public void setModelClass(Class<?> modelClass);
064    
065            public void setParallel(boolean parallel);
066    
067            public void setPerformActionMethod(
068                    PerformActionMethod<?> performActionMethod);
069    
070            public void setPerformCountMethod(PerformCountMethod performCountMethod);
071    
072            public void setPrimaryKeyPropertyName(String primaryKeyPropertyName);
073    
074            public void setTransactionConfig(TransactionConfig transactionConfig);
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    }