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.portal.service.persistence;
016    
017    import com.liferay.portal.model.PasswordPolicy;
018    
019    /**
020     * The persistence interface for the password policy service.
021     *
022     * <p>
023     * Caching information and settings can be found in <code>portal.properties</code>
024     * </p>
025     *
026     * @author Brian Wing Shun Chan
027     * @see PasswordPolicyPersistenceImpl
028     * @see PasswordPolicyUtil
029     * @generated
030     */
031    public interface PasswordPolicyPersistence extends BasePersistence<PasswordPolicy> {
032            /*
033             * NOTE FOR DEVELOPERS:
034             *
035             * Never modify or reference this interface directly. Always use {@link PasswordPolicyUtil} to access the password policy persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
036             */
037    
038            /**
039            * Returns the password policy where companyId = &#63; and defaultPolicy = &#63; or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
040            *
041            * @param companyId the company ID
042            * @param defaultPolicy the default policy
043            * @return the matching password policy
044            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a matching password policy could not be found
045            * @throws SystemException if a system exception occurred
046            */
047            public com.liferay.portal.model.PasswordPolicy findByC_DP(long companyId,
048                    boolean defaultPolicy)
049                    throws com.liferay.portal.NoSuchPasswordPolicyException,
050                            com.liferay.portal.kernel.exception.SystemException;
051    
052            /**
053            * Returns the password policy where companyId = &#63; and defaultPolicy = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
054            *
055            * @param companyId the company ID
056            * @param defaultPolicy the default policy
057            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
058            * @throws SystemException if a system exception occurred
059            */
060            public com.liferay.portal.model.PasswordPolicy fetchByC_DP(long companyId,
061                    boolean defaultPolicy)
062                    throws com.liferay.portal.kernel.exception.SystemException;
063    
064            /**
065            * Returns the password policy where companyId = &#63; and defaultPolicy = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
066            *
067            * @param companyId the company ID
068            * @param defaultPolicy the default policy
069            * @param retrieveFromCache whether to use the finder cache
070            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
071            * @throws SystemException if a system exception occurred
072            */
073            public com.liferay.portal.model.PasswordPolicy fetchByC_DP(long companyId,
074                    boolean defaultPolicy, boolean retrieveFromCache)
075                    throws com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Removes the password policy where companyId = &#63; and defaultPolicy = &#63; from the database.
079            *
080            * @param companyId the company ID
081            * @param defaultPolicy the default policy
082            * @return the password policy that was removed
083            * @throws SystemException if a system exception occurred
084            */
085            public com.liferay.portal.model.PasswordPolicy removeByC_DP(
086                    long companyId, boolean defaultPolicy)
087                    throws com.liferay.portal.NoSuchPasswordPolicyException,
088                            com.liferay.portal.kernel.exception.SystemException;
089    
090            /**
091            * Returns the number of password policies where companyId = &#63; and defaultPolicy = &#63;.
092            *
093            * @param companyId the company ID
094            * @param defaultPolicy the default policy
095            * @return the number of matching password policies
096            * @throws SystemException if a system exception occurred
097            */
098            public int countByC_DP(long companyId, boolean defaultPolicy)
099                    throws com.liferay.portal.kernel.exception.SystemException;
100    
101            /**
102            * Returns the password policy where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
103            *
104            * @param companyId the company ID
105            * @param name the name
106            * @return the matching password policy
107            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a matching password policy could not be found
108            * @throws SystemException if a system exception occurred
109            */
110            public com.liferay.portal.model.PasswordPolicy findByC_N(long companyId,
111                    java.lang.String name)
112                    throws com.liferay.portal.NoSuchPasswordPolicyException,
113                            com.liferay.portal.kernel.exception.SystemException;
114    
115            /**
116            * Returns the password policy where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
117            *
118            * @param companyId the company ID
119            * @param name the name
120            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
121            * @throws SystemException if a system exception occurred
122            */
123            public com.liferay.portal.model.PasswordPolicy fetchByC_N(long companyId,
124                    java.lang.String name)
125                    throws com.liferay.portal.kernel.exception.SystemException;
126    
127            /**
128            * Returns the password policy where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
129            *
130            * @param companyId the company ID
131            * @param name the name
132            * @param retrieveFromCache whether to use the finder cache
133            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
134            * @throws SystemException if a system exception occurred
135            */
136            public com.liferay.portal.model.PasswordPolicy fetchByC_N(long companyId,
137                    java.lang.String name, boolean retrieveFromCache)
138                    throws com.liferay.portal.kernel.exception.SystemException;
139    
140            /**
141            * Removes the password policy where companyId = &#63; and name = &#63; from the database.
142            *
143            * @param companyId the company ID
144            * @param name the name
145            * @return the password policy that was removed
146            * @throws SystemException if a system exception occurred
147            */
148            public com.liferay.portal.model.PasswordPolicy removeByC_N(long companyId,
149                    java.lang.String name)
150                    throws com.liferay.portal.NoSuchPasswordPolicyException,
151                            com.liferay.portal.kernel.exception.SystemException;
152    
153            /**
154            * Returns the number of password policies where companyId = &#63; and name = &#63;.
155            *
156            * @param companyId the company ID
157            * @param name the name
158            * @return the number of matching password policies
159            * @throws SystemException if a system exception occurred
160            */
161            public int countByC_N(long companyId, java.lang.String name)
162                    throws com.liferay.portal.kernel.exception.SystemException;
163    
164            /**
165            * Caches the password policy in the entity cache if it is enabled.
166            *
167            * @param passwordPolicy the password policy
168            */
169            public void cacheResult(
170                    com.liferay.portal.model.PasswordPolicy passwordPolicy);
171    
172            /**
173            * Caches the password policies in the entity cache if it is enabled.
174            *
175            * @param passwordPolicies the password policies
176            */
177            public void cacheResult(
178                    java.util.List<com.liferay.portal.model.PasswordPolicy> passwordPolicies);
179    
180            /**
181            * Creates a new password policy with the primary key. Does not add the password policy to the database.
182            *
183            * @param passwordPolicyId the primary key for the new password policy
184            * @return the new password policy
185            */
186            public com.liferay.portal.model.PasswordPolicy create(long passwordPolicyId);
187    
188            /**
189            * Removes the password policy with the primary key from the database. Also notifies the appropriate model listeners.
190            *
191            * @param passwordPolicyId the primary key of the password policy
192            * @return the password policy that was removed
193            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a password policy with the primary key could not be found
194            * @throws SystemException if a system exception occurred
195            */
196            public com.liferay.portal.model.PasswordPolicy remove(long passwordPolicyId)
197                    throws com.liferay.portal.NoSuchPasswordPolicyException,
198                            com.liferay.portal.kernel.exception.SystemException;
199    
200            public com.liferay.portal.model.PasswordPolicy updateImpl(
201                    com.liferay.portal.model.PasswordPolicy passwordPolicy)
202                    throws com.liferay.portal.kernel.exception.SystemException;
203    
204            /**
205            * Returns the password policy with the primary key or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
206            *
207            * @param passwordPolicyId the primary key of the password policy
208            * @return the password policy
209            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a password policy with the primary key could not be found
210            * @throws SystemException if a system exception occurred
211            */
212            public com.liferay.portal.model.PasswordPolicy findByPrimaryKey(
213                    long passwordPolicyId)
214                    throws com.liferay.portal.NoSuchPasswordPolicyException,
215                            com.liferay.portal.kernel.exception.SystemException;
216    
217            /**
218            * Returns the password policy with the primary key or returns <code>null</code> if it could not be found.
219            *
220            * @param passwordPolicyId the primary key of the password policy
221            * @return the password policy, or <code>null</code> if a password policy with the primary key could not be found
222            * @throws SystemException if a system exception occurred
223            */
224            public com.liferay.portal.model.PasswordPolicy fetchByPrimaryKey(
225                    long passwordPolicyId)
226                    throws com.liferay.portal.kernel.exception.SystemException;
227    
228            /**
229            * Returns all the password policies.
230            *
231            * @return the password policies
232            * @throws SystemException if a system exception occurred
233            */
234            public java.util.List<com.liferay.portal.model.PasswordPolicy> findAll()
235                    throws com.liferay.portal.kernel.exception.SystemException;
236    
237            /**
238            * Returns a range of all the password policies.
239            *
240            * <p>
241            * 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PasswordPolicyModelImpl}. 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.
242            * </p>
243            *
244            * @param start the lower bound of the range of password policies
245            * @param end the upper bound of the range of password policies (not inclusive)
246            * @return the range of password policies
247            * @throws SystemException if a system exception occurred
248            */
249            public java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
250                    int start, int end)
251                    throws com.liferay.portal.kernel.exception.SystemException;
252    
253            /**
254            * Returns an ordered range of all the password policies.
255            *
256            * <p>
257            * 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PasswordPolicyModelImpl}. 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.
258            * </p>
259            *
260            * @param start the lower bound of the range of password policies
261            * @param end the upper bound of the range of password policies (not inclusive)
262            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
263            * @return the ordered range of password policies
264            * @throws SystemException if a system exception occurred
265            */
266            public java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
267                    int start, int end,
268                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
269                    throws com.liferay.portal.kernel.exception.SystemException;
270    
271            /**
272            * Removes all the password policies from the database.
273            *
274            * @throws SystemException if a system exception occurred
275            */
276            public void removeAll()
277                    throws com.liferay.portal.kernel.exception.SystemException;
278    
279            /**
280            * Returns the number of password policies.
281            *
282            * @return the number of password policies
283            * @throws SystemException if a system exception occurred
284            */
285            public int countAll()
286                    throws com.liferay.portal.kernel.exception.SystemException;
287    }