1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="RolePersistence.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public interface RolePersistence extends BasePersistence {
29      public void cacheResult(com.liferay.portal.model.Role role);
30  
31      public void cacheResult(java.util.List<com.liferay.portal.model.Role> roles);
32  
33      public void clearCache();
34  
35      public com.liferay.portal.model.Role create(long roleId);
36  
37      public com.liferay.portal.model.Role remove(long roleId)
38          throws com.liferay.portal.NoSuchRoleException,
39              com.liferay.portal.SystemException;
40  
41      public com.liferay.portal.model.Role remove(
42          com.liferay.portal.model.Role role)
43          throws com.liferay.portal.SystemException;
44  
45      /**
46       * @deprecated Use <code>update(Role role, boolean merge)</code>.
47       */
48      public com.liferay.portal.model.Role update(
49          com.liferay.portal.model.Role role)
50          throws com.liferay.portal.SystemException;
51  
52      /**
53       * Add, update, or merge, the entity. This method also calls the model
54       * listeners to trigger the proper events associated with adding, deleting,
55       * or updating an entity.
56       *
57       * @param        role the entity to add, update, or merge
58       * @param        merge boolean value for whether to merge the entity. The
59       *                default value is false. Setting merge to true is more
60       *                expensive and should only be true when role is
61       *                transient. See LEP-5473 for a detailed discussion of this
62       *                method.
63       * @return        true if the portlet can be displayed via Ajax
64       */
65      public com.liferay.portal.model.Role update(
66          com.liferay.portal.model.Role role, boolean merge)
67          throws com.liferay.portal.SystemException;
68  
69      public com.liferay.portal.model.Role updateImpl(
70          com.liferay.portal.model.Role role, boolean merge)
71          throws com.liferay.portal.SystemException;
72  
73      public com.liferay.portal.model.Role findByPrimaryKey(long roleId)
74          throws com.liferay.portal.NoSuchRoleException,
75              com.liferay.portal.SystemException;
76  
77      public com.liferay.portal.model.Role fetchByPrimaryKey(long roleId)
78          throws com.liferay.portal.SystemException;
79  
80      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
81          long companyId) throws com.liferay.portal.SystemException;
82  
83      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
84          long companyId, int start, int end)
85          throws com.liferay.portal.SystemException;
86  
87      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
88          long companyId, int start, int end,
89          com.liferay.portal.kernel.util.OrderByComparator obc)
90          throws com.liferay.portal.SystemException;
91  
92      public com.liferay.portal.model.Role findByCompanyId_First(long companyId,
93          com.liferay.portal.kernel.util.OrderByComparator obc)
94          throws com.liferay.portal.NoSuchRoleException,
95              com.liferay.portal.SystemException;
96  
97      public com.liferay.portal.model.Role findByCompanyId_Last(long companyId,
98          com.liferay.portal.kernel.util.OrderByComparator obc)
99          throws com.liferay.portal.NoSuchRoleException,
100             com.liferay.portal.SystemException;
101 
102     public com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext(
103         long roleId, long companyId,
104         com.liferay.portal.kernel.util.OrderByComparator obc)
105         throws com.liferay.portal.NoSuchRoleException,
106             com.liferay.portal.SystemException;
107 
108     public com.liferay.portal.model.Role findByC_N(long companyId,
109         java.lang.String name)
110         throws com.liferay.portal.NoSuchRoleException,
111             com.liferay.portal.SystemException;
112 
113     public com.liferay.portal.model.Role fetchByC_N(long companyId,
114         java.lang.String name) throws com.liferay.portal.SystemException;
115 
116     public com.liferay.portal.model.Role fetchByC_N(long companyId,
117         java.lang.String name, boolean retrieveFromCache)
118         throws com.liferay.portal.SystemException;
119 
120     public com.liferay.portal.model.Role findByC_C_C(long companyId,
121         long classNameId, long classPK)
122         throws com.liferay.portal.NoSuchRoleException,
123             com.liferay.portal.SystemException;
124 
125     public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
126         long classNameId, long classPK)
127         throws com.liferay.portal.SystemException;
128 
129     public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
130         long classNameId, long classPK, boolean retrieveFromCache)
131         throws com.liferay.portal.SystemException;
132 
133     public java.util.List<Object> findWithDynamicQuery(
134         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
135         throws com.liferay.portal.SystemException;
136 
137     public java.util.List<Object> findWithDynamicQuery(
138         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
139         int end) throws com.liferay.portal.SystemException;
140 
141     public java.util.List<com.liferay.portal.model.Role> findAll()
142         throws com.liferay.portal.SystemException;
143 
144     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
145         int end) throws com.liferay.portal.SystemException;
146 
147     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
148         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.SystemException;
150 
151     public void removeByCompanyId(long companyId)
152         throws com.liferay.portal.SystemException;
153 
154     public void removeByC_N(long companyId, java.lang.String name)
155         throws com.liferay.portal.NoSuchRoleException,
156             com.liferay.portal.SystemException;
157 
158     public void removeByC_C_C(long companyId, long classNameId, long classPK)
159         throws com.liferay.portal.NoSuchRoleException,
160             com.liferay.portal.SystemException;
161 
162     public void removeAll() throws com.liferay.portal.SystemException;
163 
164     public int countByCompanyId(long companyId)
165         throws com.liferay.portal.SystemException;
166 
167     public int countByC_N(long companyId, java.lang.String name)
168         throws com.liferay.portal.SystemException;
169 
170     public int countByC_C_C(long companyId, long classNameId, long classPK)
171         throws com.liferay.portal.SystemException;
172 
173     public int countAll() throws com.liferay.portal.SystemException;
174 
175     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
176         throws com.liferay.portal.SystemException;
177 
178     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
179         int start, int end) throws com.liferay.portal.SystemException;
180 
181     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
182         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
183         throws com.liferay.portal.SystemException;
184 
185     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
186 
187     public boolean containsGroup(long pk, long groupPK)
188         throws com.liferay.portal.SystemException;
189 
190     public boolean containsGroups(long pk)
191         throws com.liferay.portal.SystemException;
192 
193     public void addGroup(long pk, long groupPK)
194         throws com.liferay.portal.SystemException;
195 
196     public void addGroup(long pk, com.liferay.portal.model.Group group)
197         throws com.liferay.portal.SystemException;
198 
199     public void addGroups(long pk, long[] groupPKs)
200         throws com.liferay.portal.SystemException;
201 
202     public void addGroups(long pk,
203         java.util.List<com.liferay.portal.model.Group> groups)
204         throws com.liferay.portal.SystemException;
205 
206     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
207 
208     public void removeGroup(long pk, long groupPK)
209         throws com.liferay.portal.SystemException;
210 
211     public void removeGroup(long pk, com.liferay.portal.model.Group group)
212         throws com.liferay.portal.SystemException;
213 
214     public void removeGroups(long pk, long[] groupPKs)
215         throws com.liferay.portal.SystemException;
216 
217     public void removeGroups(long pk,
218         java.util.List<com.liferay.portal.model.Group> groups)
219         throws com.liferay.portal.SystemException;
220 
221     public void setGroups(long pk, long[] groupPKs)
222         throws com.liferay.portal.SystemException;
223 
224     public void setGroups(long pk,
225         java.util.List<com.liferay.portal.model.Group> groups)
226         throws com.liferay.portal.SystemException;
227 
228     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
229         long pk) throws com.liferay.portal.SystemException;
230 
231     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
232         long pk, int start, int end) throws com.liferay.portal.SystemException;
233 
234     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
235         long pk, int start, int end,
236         com.liferay.portal.kernel.util.OrderByComparator obc)
237         throws com.liferay.portal.SystemException;
238 
239     public int getPermissionsSize(long pk)
240         throws com.liferay.portal.SystemException;
241 
242     public boolean containsPermission(long pk, long permissionPK)
243         throws com.liferay.portal.SystemException;
244 
245     public boolean containsPermissions(long pk)
246         throws com.liferay.portal.SystemException;
247 
248     public void addPermission(long pk, long permissionPK)
249         throws com.liferay.portal.SystemException;
250 
251     public void addPermission(long pk,
252         com.liferay.portal.model.Permission permission)
253         throws com.liferay.portal.SystemException;
254 
255     public void addPermissions(long pk, long[] permissionPKs)
256         throws com.liferay.portal.SystemException;
257 
258     public void addPermissions(long pk,
259         java.util.List<com.liferay.portal.model.Permission> permissions)
260         throws com.liferay.portal.SystemException;
261 
262     public void clearPermissions(long pk)
263         throws com.liferay.portal.SystemException;
264 
265     public void removePermission(long pk, long permissionPK)
266         throws com.liferay.portal.SystemException;
267 
268     public void removePermission(long pk,
269         com.liferay.portal.model.Permission permission)
270         throws com.liferay.portal.SystemException;
271 
272     public void removePermissions(long pk, long[] permissionPKs)
273         throws com.liferay.portal.SystemException;
274 
275     public void removePermissions(long pk,
276         java.util.List<com.liferay.portal.model.Permission> permissions)
277         throws com.liferay.portal.SystemException;
278 
279     public void setPermissions(long pk, long[] permissionPKs)
280         throws com.liferay.portal.SystemException;
281 
282     public void setPermissions(long pk,
283         java.util.List<com.liferay.portal.model.Permission> permissions)
284         throws com.liferay.portal.SystemException;
285 
286     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
287         throws com.liferay.portal.SystemException;
288 
289     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
290         int start, int end) throws com.liferay.portal.SystemException;
291 
292     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
293         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
294         throws com.liferay.portal.SystemException;
295 
296     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
297 
298     public boolean containsUser(long pk, long userPK)
299         throws com.liferay.portal.SystemException;
300 
301     public boolean containsUsers(long pk)
302         throws com.liferay.portal.SystemException;
303 
304     public void addUser(long pk, long userPK)
305         throws com.liferay.portal.SystemException;
306 
307     public void addUser(long pk, com.liferay.portal.model.User user)
308         throws com.liferay.portal.SystemException;
309 
310     public void addUsers(long pk, long[] userPKs)
311         throws com.liferay.portal.SystemException;
312 
313     public void addUsers(long pk,
314         java.util.List<com.liferay.portal.model.User> users)
315         throws com.liferay.portal.SystemException;
316 
317     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
318 
319     public void removeUser(long pk, long userPK)
320         throws com.liferay.portal.SystemException;
321 
322     public void removeUser(long pk, com.liferay.portal.model.User user)
323         throws com.liferay.portal.SystemException;
324 
325     public void removeUsers(long pk, long[] userPKs)
326         throws com.liferay.portal.SystemException;
327 
328     public void removeUsers(long pk,
329         java.util.List<com.liferay.portal.model.User> users)
330         throws com.liferay.portal.SystemException;
331 
332     public void setUsers(long pk, long[] userPKs)
333         throws com.liferay.portal.SystemException;
334 
335     public void setUsers(long pk,
336         java.util.List<com.liferay.portal.model.User> users)
337         throws com.liferay.portal.SystemException;
338 }