1
14
15 package com.liferay.portal.service.persistence;
16
17 import com.liferay.portal.NoSuchModelException;
18 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
19 import com.liferay.portal.kernel.exception.SystemException;
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
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 }