1
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 import javax.sql.DataSource;
29
30
35 public interface BasePersistence<T extends BaseModel<T>> {
36
37 public void clearCache();
38
39 public void clearCache(T model);
40
41 public int countWithDynamicQuery(DynamicQuery dynamicQuery)
42 throws SystemException;
43
44 public T fetchByPrimaryKey(Serializable primaryKey) throws SystemException;
45
46 public T findByPrimaryKey(Serializable primaryKey)
47 throws NoSuchModelException, SystemException;
48
49 @SuppressWarnings("rawtypes")
50 public List findWithDynamicQuery(DynamicQuery dynamicQuery)
51 throws SystemException;
52
53 @SuppressWarnings("rawtypes")
54 public List findWithDynamicQuery(
55 DynamicQuery dynamicQuery, int start, int end)
56 throws SystemException;
57
58 @SuppressWarnings("rawtypes")
59 public List findWithDynamicQuery(
60 DynamicQuery dynamicQuery, int start, int end,
61 OrderByComparator orderByComparator)
62 throws SystemException;
63
64 public DataSource getDataSource();
65
66 public ModelListener<T>[] getListeners();
67
68 public void registerListener(ModelListener<T> listener);
69
70 public T remove(Serializable primaryKey)
71 throws NoSuchModelException, SystemException;
72
73 public T remove(T model) throws SystemException;
74
75 public void setDataSource(DataSource dataSource);
76
77 public void unregisterListener(ModelListener<T> listener);
78
79 public T update(T model, boolean merge) throws SystemException;
80
81 }