1 /*
2 * File: AbstractQuery.java
3 * Created: 30.05.2007 10:43:19
4 *
5 * Copyright 2007 Michal Burda.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 package net.sf.webmancer.db;
23
24 import java.util.List;
25 import java.util.Map;
26
27 /**
28 * @author Michal Burda
29 *
30 */
31 public interface IDatabaseOperationPerformer {
32
33 /**
34 * @param conditions
35 * @return
36 */
37 long performDelete(List<ICondition> conditions);
38
39 /**
40 * @param row
41 */
42 void performInsert(Map<IAttribute, ICell> row);
43
44 /**
45 * @param data
46 */
47 void performInsert(IData data);
48
49 /**
50 * @param conditions
51 * @return
52 */
53 long performQueryCount(List<ICondition> conditions);
54
55 /**
56 * @param attributes
57 * @param conditions
58 * @param limit
59 * @param offset
60 * @param orderingAttribute
61 * @param ascending
62 * @return
63 */
64 IData performQueryResult(Map<String, IAttribute> attributes, List<ICondition> conditions, long limit, long offset,
65 IAttribute orderingAttribute, boolean ascending);
66
67 /**
68 * @param row
69 * @param conditions
70 * @return
71 */
72 long performUpdate(Map<IAttribute, ICell> row, List<ICondition> conditions);
73
74 }