View Javadoc

1   /*
2    * File:    TableDataSet.java
3    * Created: 28.4.2007 11:35:44
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.sql;
23  
24  import java.util.List;
25  import java.util.Map;
26  
27  import net.sf.webmancer.db.IAttribute;
28  import net.sf.webmancer.db.ICell;
29  import net.sf.webmancer.db.ICondition;
30  import net.sf.webmancer.db.IData;
31  import net.sf.webmancer.util.ContractChecker;
32  
33  /**
34   * @author Michal Burda
35   *
36   */
37  public class TableDataSet extends AbstractSqlDataSet {
38      /**
39       * 
40       */
41      private String tableName;
42      
43      /**
44       * Constructs the TableDataSet.
45       *
46       */
47      public TableDataSet() {
48          super();
49      }
50      
51      /**
52       * Returns the tableName.
53       *
54       * @return the tableName
55       */
56      protected String getTableName() {
57          return this.tableName;
58      }
59  
60      /**
61       * Sets the tableName.
62       *
63       * @param tableName the tableName to set
64       */
65      public void setTableName(String tableName) {
66          ContractChecker.mustNotBeEmpty(tableName, "tableName");
67          this.tableName = tableName;
68      }
69  
70      /**
71       * @param conditions
72       * @return
73       */
74      protected String createWherePart(List<ICondition> conditions) {
75          // TODO Auto-generated method stub
76          throw new UnsupportedOperationException("createWherePart");
77      }
78  
79      /**
80       * @see net.sf.webmancer.db.AbstractDataSet#performDelete(java.util.List)
81       */
82      @Override
83      public long performDelete(List<ICondition> conditions) {
84          String wherePart = createWherePart(conditions);
85          
86  //        getJdbcTemplate().update("DELETE FROM " + getTableName() + );
87          // TODO Auto-generated method stub
88          throw new UnsupportedOperationException("performDelete");
89      }
90  
91      /**
92       * @see net.sf.webmancer.db.AbstractDataSet#performInsert(java.util.Map)
93       */
94      @Override
95      public void performInsert(Map<IAttribute, ICell> row) {
96          // TODO Auto-generated method stub
97          throw new UnsupportedOperationException("performInsert");
98      }
99  
100     /**
101      * @see net.sf.webmancer.db.AbstractDataSet#performInsert(net.sf.webmancer.db.IData)
102      */
103     @Override
104     public void performInsert(IData data) {
105         // TODO Auto-generated method stub
106         throw new UnsupportedOperationException("performInsert");
107     }
108 
109     /**
110      * @see net.sf.webmancer.db.AbstractDataSet#performQueryCount(java.util.List)
111      */
112     @Override
113     public long performQueryCount(List<ICondition> conditions) {
114         // TODO Auto-generated method stub
115         throw new UnsupportedOperationException("performQueryCount");
116     }
117 
118     /**
119      * @see net.sf.webmancer.db.AbstractDataSet#performQueryResult(java.util.Map, java.util.List, long, long, net.sf.webmancer.db.IAttribute, boolean)
120      */
121     @Override
122     public IData performQueryResult(Map<String, IAttribute> attributes, List<ICondition> conditions, long limit, long offset, IAttribute orderingAttribute, boolean ascending) {
123         // TODO Auto-generated method stub
124         throw new UnsupportedOperationException("performQueryResult");
125     }
126 
127     /**
128      * @see net.sf.webmancer.db.AbstractDataSet#performUpdate(java.util.Map, java.util.List)
129      */
130     @Override
131     public long performUpdate(Map<IAttribute, ICell> row, List<ICondition> conditions) {
132         // TODO Auto-generated method stub
133         throw new UnsupportedOperationException("performUpdate");
134     }
135 }