View Javadoc

1   /*
2    * Copyright 2004-2006 the Seasar Foundation and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.seasar.tuigwaa.model;
17  
18  import org.seasar.tuigwaa.database.DataTable;
19  import org.seasar.tuigwaa.database.function.criteria.CriteriaFunction;
20  import org.seasar.tuigwaa.model.core.TgwEntity;
21  
22  public interface DataService {
23  
24  	public static final String DAOTYPE_FILTER = "filter";
25  
26  	public static final String DAOTYPE_AGGREGATION = "aggregation";
27  
28  	public static final String DAOTYPE_VALUE = "value";
29  
30  	public Object load(TgwEntity entity, Long id);
31  
32  	public Object loadByValue(TgwEntity entity, String attrName, Object value);
33  
34  	public Long saveOrUpdate(TgwEntity entity, Object dto);
35  
36  	public Long saveOrUpdate(TgwEntity entity, Object dto, String methodName);
37  
38  	public void delete(TgwEntity entity, Long id);
39  
40  	public void deleteByFilter(TgwEntity entity, String methodName);
41  
42  	public void deleteAll(TgwEntity entity);
43  
44  	public DataTable list(TgwEntity entity);
45  
46  	public DataTable search(TgwEntity entity, String methodName, Object dto);
47  
48  	public DataTable search(TgwEntity entity, String methodName, Object dto,
49  			CriteriaFunction extraCriteria);
50  
51  	public DataTable find(TgwEntity entity, String methodName);
52  
53  	public DataTable find(TgwEntity entity, String methodName,
54  			CriteriaFunction extraCriteria);
55  
56  	public DataTable searchByFilter(TgwEntity entity, String searchMethodName,
57  			Object dto, String filterMethodName);
58  
59  	public DataTable searchByFilter(TgwEntity entity, String searchMethodName,
60  			Object dto, String filterMethodName, CriteriaFunction extraCriteria);
61  
62  	public int rowCount(TgwEntity entity);
63  
64  	public int rowCountBySearch(TgwEntity entity, String searchMethodName, Object dto);
65  		 
66  	public int rowCountByFilter(TgwEntity entity, String filterName,
67  			CriteriaFunction extraCriteria);
68  
69  	public int rowCountByFilter(TgwEntity entity, String filterName,
70  			String searchName, Object dto);
71  	
72  	public Object getValue(TgwEntity entity, String methodName);
73  
74  	public Object getValue(TgwEntity entity, String methodName,
75  			CriteriaFunction extraCriteria);
76  }