1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="RegionPersistence.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public interface RegionPersistence {
32      public com.liferay.portal.model.Region create(long regionId);
33  
34      public com.liferay.portal.model.Region remove(long regionId)
35          throws com.liferay.portal.NoSuchRegionException,
36              com.liferay.portal.SystemException;
37  
38      public com.liferay.portal.model.Region remove(
39          com.liferay.portal.model.Region region)
40          throws com.liferay.portal.SystemException;
41  
42      /**
43       * @deprecated Use <code>update(Region region, boolean merge)</code>.
44       */
45      public com.liferay.portal.model.Region update(
46          com.liferay.portal.model.Region region)
47          throws com.liferay.portal.SystemException;
48  
49      /**
50       * Add, update, or merge, the entity. This method also calls the model
51       * listeners to trigger the proper events associated with adding, deleting,
52       * or updating an entity.
53       *
54       * @param        region the entity to add, update, or merge
55       * @param        merge boolean value for whether to merge the entity. The
56       *                default value is false. Setting merge to true is more
57       *                expensive and should only be true when region is
58       *                transient. See LEP-5473 for a detailed discussion of this
59       *                method.
60       * @return        true if the portlet can be displayed via Ajax
61       */
62      public com.liferay.portal.model.Region update(
63          com.liferay.portal.model.Region region, boolean merge)
64          throws com.liferay.portal.SystemException;
65  
66      public com.liferay.portal.model.Region updateImpl(
67          com.liferay.portal.model.Region region, boolean merge)
68          throws com.liferay.portal.SystemException;
69  
70      public com.liferay.portal.model.Region findByPrimaryKey(long regionId)
71          throws com.liferay.portal.NoSuchRegionException,
72              com.liferay.portal.SystemException;
73  
74      public com.liferay.portal.model.Region fetchByPrimaryKey(long regionId)
75          throws com.liferay.portal.SystemException;
76  
77      public java.util.List<com.liferay.portal.model.Region> findByCountryId(
78          long countryId) throws com.liferay.portal.SystemException;
79  
80      public java.util.List<com.liferay.portal.model.Region> findByCountryId(
81          long countryId, int start, int end)
82          throws com.liferay.portal.SystemException;
83  
84      public java.util.List<com.liferay.portal.model.Region> findByCountryId(
85          long countryId, int start, int end,
86          com.liferay.portal.kernel.util.OrderByComparator obc)
87          throws com.liferay.portal.SystemException;
88  
89      public com.liferay.portal.model.Region findByCountryId_First(
90          long countryId, com.liferay.portal.kernel.util.OrderByComparator obc)
91          throws com.liferay.portal.NoSuchRegionException,
92              com.liferay.portal.SystemException;
93  
94      public com.liferay.portal.model.Region findByCountryId_Last(
95          long countryId, com.liferay.portal.kernel.util.OrderByComparator obc)
96          throws com.liferay.portal.NoSuchRegionException,
97              com.liferay.portal.SystemException;
98  
99      public com.liferay.portal.model.Region[] findByCountryId_PrevAndNext(
100         long regionId, long countryId,
101         com.liferay.portal.kernel.util.OrderByComparator obc)
102         throws com.liferay.portal.NoSuchRegionException,
103             com.liferay.portal.SystemException;
104 
105     public java.util.List<com.liferay.portal.model.Region> findByActive(
106         boolean active) throws com.liferay.portal.SystemException;
107 
108     public java.util.List<com.liferay.portal.model.Region> findByActive(
109         boolean active, int start, int end)
110         throws com.liferay.portal.SystemException;
111 
112     public java.util.List<com.liferay.portal.model.Region> findByActive(
113         boolean active, int start, int end,
114         com.liferay.portal.kernel.util.OrderByComparator obc)
115         throws com.liferay.portal.SystemException;
116 
117     public com.liferay.portal.model.Region findByActive_First(boolean active,
118         com.liferay.portal.kernel.util.OrderByComparator obc)
119         throws com.liferay.portal.NoSuchRegionException,
120             com.liferay.portal.SystemException;
121 
122     public com.liferay.portal.model.Region findByActive_Last(boolean active,
123         com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.NoSuchRegionException,
125             com.liferay.portal.SystemException;
126 
127     public com.liferay.portal.model.Region[] findByActive_PrevAndNext(
128         long regionId, boolean active,
129         com.liferay.portal.kernel.util.OrderByComparator obc)
130         throws com.liferay.portal.NoSuchRegionException,
131             com.liferay.portal.SystemException;
132 
133     public java.util.List<com.liferay.portal.model.Region> findByC_A(
134         long countryId, boolean active)
135         throws com.liferay.portal.SystemException;
136 
137     public java.util.List<com.liferay.portal.model.Region> findByC_A(
138         long countryId, boolean active, int start, int end)
139         throws com.liferay.portal.SystemException;
140 
141     public java.util.List<com.liferay.portal.model.Region> findByC_A(
142         long countryId, boolean active, int start, int end,
143         com.liferay.portal.kernel.util.OrderByComparator obc)
144         throws com.liferay.portal.SystemException;
145 
146     public com.liferay.portal.model.Region findByC_A_First(long countryId,
147         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
148         throws com.liferay.portal.NoSuchRegionException,
149             com.liferay.portal.SystemException;
150 
151     public com.liferay.portal.model.Region findByC_A_Last(long countryId,
152         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
153         throws com.liferay.portal.NoSuchRegionException,
154             com.liferay.portal.SystemException;
155 
156     public com.liferay.portal.model.Region[] findByC_A_PrevAndNext(
157         long regionId, long countryId, boolean active,
158         com.liferay.portal.kernel.util.OrderByComparator obc)
159         throws com.liferay.portal.NoSuchRegionException,
160             com.liferay.portal.SystemException;
161 
162     public java.util.List<Object> findWithDynamicQuery(
163         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
164         throws com.liferay.portal.SystemException;
165 
166     public java.util.List<Object> findWithDynamicQuery(
167         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
168         int end) throws com.liferay.portal.SystemException;
169 
170     public java.util.List<com.liferay.portal.model.Region> findAll()
171         throws com.liferay.portal.SystemException;
172 
173     public java.util.List<com.liferay.portal.model.Region> findAll(int start,
174         int end) throws com.liferay.portal.SystemException;
175 
176     public java.util.List<com.liferay.portal.model.Region> findAll(int start,
177         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
178         throws com.liferay.portal.SystemException;
179 
180     public void removeByCountryId(long countryId)
181         throws com.liferay.portal.SystemException;
182 
183     public void removeByActive(boolean active)
184         throws com.liferay.portal.SystemException;
185 
186     public void removeByC_A(long countryId, boolean active)
187         throws com.liferay.portal.SystemException;
188 
189     public void removeAll() throws com.liferay.portal.SystemException;
190 
191     public int countByCountryId(long countryId)
192         throws com.liferay.portal.SystemException;
193 
194     public int countByActive(boolean active)
195         throws com.liferay.portal.SystemException;
196 
197     public int countByC_A(long countryId, boolean active)
198         throws com.liferay.portal.SystemException;
199 
200     public int countAll() throws com.liferay.portal.SystemException;
201 
202     public void registerListener(
203         com.liferay.portal.model.ModelListener listener);
204 
205     public void unregisterListener(
206         com.liferay.portal.model.ModelListener listener);
207 }