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.model.BaseModel;
21  import com.liferay.portal.model.ModelListener;
22  
23  import java.io.Serializable;
24  
25  import java.util.List;
26  
27  /**
28   * <a href="BasePersistence.java.html"><b><i>View Source</i></b></a>
29   *
30   * @author Brian Wing Shun Chan
31   */
32  public interface BasePersistence<T extends BaseModel<T>> {
33  
34      public void clearCache();
35  
36      public T findByPrimaryKey(Serializable primaryKey)
37          throws NoSuchModelException, SystemException;
38  
39      public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
40          throws SystemException;
41  
42      public List<Object> findWithDynamicQuery(
43              DynamicQuery dynamicQuery, int start, int end)
44          throws SystemException;
45  
46      public T fetchByPrimaryKey(Serializable primaryKey) throws SystemException;
47  
48      public ModelListener<T>[] getListeners();
49  
50      public void registerListener(ModelListener<T> listener);
51  
52      public T remove(Serializable primaryKey)
53          throws NoSuchModelException, SystemException;
54  
55      public T remove(T model) throws SystemException;
56  
57      public void unregisterListener(ModelListener<T> listener);
58  
59      public T update(T model, boolean merge) throws SystemException;
60  
61  }