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  import com.liferay.portal.PortalException;
23  import com.liferay.portal.SystemException;
24  import com.liferay.portal.kernel.annotation.Propagation;
25  import com.liferay.portal.kernel.annotation.Transactional;
26  
27  /**
28   * <a href="CountryPersistence.java.html"><b><i>View Source</i></b></a>
29   *
30   * @author Brian Wing Shun Chan
31   *
32   */
33  @Transactional(rollbackFor =  {
34      PortalException.class, SystemException.class})
35  public interface CountryPersistence extends BasePersistence {
36      public com.liferay.portal.model.Country create(long countryId);
37  
38      public com.liferay.portal.model.Country remove(long countryId)
39          throws com.liferay.portal.NoSuchCountryException,
40              com.liferay.portal.SystemException;
41  
42      public com.liferay.portal.model.Country remove(
43          com.liferay.portal.model.Country country)
44          throws com.liferay.portal.SystemException;
45  
46      /**
47       * @deprecated Use <code>update(Country country, boolean merge)</code>.
48       */
49      public com.liferay.portal.model.Country update(
50          com.liferay.portal.model.Country country)
51          throws com.liferay.portal.SystemException;
52  
53      /**
54       * Add, update, or merge, the entity. This method also calls the model
55       * listeners to trigger the proper events associated with adding, deleting,
56       * or updating an entity.
57       *
58       * @param        country the entity to add, update, or merge
59       * @param        merge boolean value for whether to merge the entity. The
60       *                default value is false. Setting merge to true is more
61       *                expensive and should only be true when country is
62       *                transient. See LEP-5473 for a detailed discussion of this
63       *                method.
64       * @return        true if the portlet can be displayed via Ajax
65       */
66      public com.liferay.portal.model.Country update(
67          com.liferay.portal.model.Country country, boolean merge)
68          throws com.liferay.portal.SystemException;
69  
70      public com.liferay.portal.model.Country updateImpl(
71          com.liferay.portal.model.Country country, boolean merge)
72          throws com.liferay.portal.SystemException;
73  
74      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
75      public com.liferay.portal.model.Country findByPrimaryKey(long countryId)
76          throws com.liferay.portal.NoSuchCountryException,
77              com.liferay.portal.SystemException;
78  
79      public com.liferay.portal.model.Country fetchByPrimaryKey(long countryId)
80          throws com.liferay.portal.SystemException;
81  
82      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
83      public com.liferay.portal.model.Country findByName(java.lang.String name)
84          throws com.liferay.portal.NoSuchCountryException,
85              com.liferay.portal.SystemException;
86  
87      public com.liferay.portal.model.Country fetchByName(java.lang.String name)
88          throws com.liferay.portal.SystemException;
89  
90      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
91      public com.liferay.portal.model.Country findByA2(java.lang.String a2)
92          throws com.liferay.portal.NoSuchCountryException,
93              com.liferay.portal.SystemException;
94  
95      public com.liferay.portal.model.Country fetchByA2(java.lang.String a2)
96          throws com.liferay.portal.SystemException;
97  
98      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
99      public com.liferay.portal.model.Country findByA3(java.lang.String a3)
100         throws com.liferay.portal.NoSuchCountryException,
101             com.liferay.portal.SystemException;
102 
103     public com.liferay.portal.model.Country fetchByA3(java.lang.String a3)
104         throws com.liferay.portal.SystemException;
105 
106     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
107     public java.util.List<com.liferay.portal.model.Country> findByActive(
108         boolean active) throws com.liferay.portal.SystemException;
109 
110     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
111     public java.util.List<com.liferay.portal.model.Country> findByActive(
112         boolean active, int start, int end)
113         throws com.liferay.portal.SystemException;
114 
115     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
116     public java.util.List<com.liferay.portal.model.Country> findByActive(
117         boolean active, int start, int end,
118         com.liferay.portal.kernel.util.OrderByComparator obc)
119         throws com.liferay.portal.SystemException;
120 
121     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
122     public com.liferay.portal.model.Country findByActive_First(boolean active,
123         com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.NoSuchCountryException,
125             com.liferay.portal.SystemException;
126 
127     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
128     public com.liferay.portal.model.Country findByActive_Last(boolean active,
129         com.liferay.portal.kernel.util.OrderByComparator obc)
130         throws com.liferay.portal.NoSuchCountryException,
131             com.liferay.portal.SystemException;
132 
133     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
134     public com.liferay.portal.model.Country[] findByActive_PrevAndNext(
135         long countryId, boolean active,
136         com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.NoSuchCountryException,
138             com.liferay.portal.SystemException;
139 
140     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
141     public java.util.List<Object> findWithDynamicQuery(
142         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
143         throws com.liferay.portal.SystemException;
144 
145     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
146     public java.util.List<Object> findWithDynamicQuery(
147         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
148         int end) throws com.liferay.portal.SystemException;
149 
150     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
151     public java.util.List<com.liferay.portal.model.Country> findAll()
152         throws com.liferay.portal.SystemException;
153 
154     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155     public java.util.List<com.liferay.portal.model.Country> findAll(int start,
156         int end) throws com.liferay.portal.SystemException;
157 
158     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
159     public java.util.List<com.liferay.portal.model.Country> findAll(int start,
160         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
161         throws com.liferay.portal.SystemException;
162 
163     public void removeByName(java.lang.String name)
164         throws com.liferay.portal.NoSuchCountryException,
165             com.liferay.portal.SystemException;
166 
167     public void removeByA2(java.lang.String a2)
168         throws com.liferay.portal.NoSuchCountryException,
169             com.liferay.portal.SystemException;
170 
171     public void removeByA3(java.lang.String a3)
172         throws com.liferay.portal.NoSuchCountryException,
173             com.liferay.portal.SystemException;
174 
175     public void removeByActive(boolean active)
176         throws com.liferay.portal.SystemException;
177 
178     public void removeAll() throws com.liferay.portal.SystemException;
179 
180     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
181     public int countByName(java.lang.String name)
182         throws com.liferay.portal.SystemException;
183 
184     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
185     public int countByA2(java.lang.String a2)
186         throws com.liferay.portal.SystemException;
187 
188     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
189     public int countByA3(java.lang.String a3)
190         throws com.liferay.portal.SystemException;
191 
192     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
193     public int countByActive(boolean active)
194         throws com.liferay.portal.SystemException;
195 
196     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
197     public int countAll() throws com.liferay.portal.SystemException;
198 }