1   /**
2    * Copyright (c) 2000-2010 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   *
12   * 
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.NoSuchModelException;
18  import com.liferay.portal.SystemException;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.OrderByComparator;
21  import com.liferay.portal.model.BaseModel;
22  import com.liferay.portal.model.ModelListener;
23  
24  import java.io.Serializable;
25  
26  import java.util.List;
27  
28  /**
29   * <a href="BasePersistence.java.html"><b><i>View Source</i></b></a>
30   *
31   * @author Brian Wing Shun Chan
32   */
33  public interface BasePersistence<T extends BaseModel<T>> {
34  
35      public void clearCache();
36  
37      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
38          throws SystemException;
39  
40      public T fetchByPrimaryKey(Serializable primaryKey) throws SystemException;
41  
42      public T findByPrimaryKey(Serializable primaryKey)
43          throws NoSuchModelException, SystemException;
44  
45      public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
46          throws SystemException;
47  
48      public List<Object> findWithDynamicQuery(
49              DynamicQuery dynamicQuery, int start, int end)
50          throws SystemException;
51  
52      public List<Object> findWithDynamicQuery(
53              DynamicQuery dynamicQuery, int start, int end,
54              OrderByComparator orderByComparator)
55          throws SystemException;
56  
57      public ModelListener<T>[] getListeners();
58  
59      public void registerListener(ModelListener<T> listener);
60  
61      public T remove(Serializable primaryKey)
62          throws NoSuchModelException, SystemException;
63  
64      public T remove(T model) throws SystemException;
65  
66      public void unregisterListener(ModelListener<T> listener);
67  
68      public T update(T model, boolean merge) throws SystemException;
69  
70  }