01: /*
02: * Created on 22/05/2004
03: *
04: * Swing Components - visit http://sf.net/projects/gfd
05: *
06: * Copyright (C) 2004 Igor Regis da Silva Simões
07: *
08: * This program is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public License
10: * as published by the Free Software Foundation; either version 2
11: * of the License, or (at your option) any later version.
12: *
13: * This program is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * GNU General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public License
19: * along with this program; if not, write to the Free Software
20: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21: *
22: */
23: package br.com.igor.db;
24:
25: import java.util.ArrayList;
26: import java.util.Map;
27:
28: /**
29: * @author Igor Regis da Silva Simoes
30: */
31: public class MSAccessSQLParser extends AbstractSQLParser {
32:
33: /**
34: * Cria uma nova instância de MSAccessDAO
35: */
36: public MSAccessSQLParser() {
37: //Não fazemos nada
38: }
39:
40: /**
41: * @see br.com.igor.db.AbstractSQLParser#getDeleteSQL(java.lang.String, java.util.Map, java.util.ArrayList, java.lang.Object[])
42: */
43: @Override
44: public ParsedPreparedStatement getDeleteSQL(String tableName,
45: Map data, ArrayList<String> columnsName,
46: ArrayList<CondicaoSQL> condicoesExtras,
47: ArrayList<String> pkNames) {
48: return parse(super .getDeleteSQL(tableName, data, columnsName,
49: condicoesExtras, pkNames));
50: }
51:
52: /**
53: * @see br.com.igor.db.AbstractSQLParser#getInsertSQL(java.lang.String, java.util.Map, java.util.ArrayList)
54: */
55: @Override
56: public ParsedPreparedStatement getInsertSQL(String tableName,
57: Map data, ArrayList<String> columnsName) {
58: return parse(super .getInsertSQL(tableName, data, columnsName));
59: }
60:
61: /**
62: * @see br.com.igor.db.AbstractSQLParser#getSelectSQL(java.lang.String, java.lang.String, java.util.Map, java.util.ArrayList, java.lang.String[], boolean[], java.lang.Object[])
63: */
64: @Override
65: public ParsedPreparedStatement getSelectSQL(
66: String resultadoDesejado, String tableName, Map data,
67: ArrayList<String> columnsName, String[] orderByColumns,
68: boolean[] crescente, ArrayList<CondicaoSQL> condicoesExtras) {
69: return parse(super .getSelectSQL(resultadoDesejado, tableName,
70: data, columnsName, orderByColumns, crescente,
71: condicoesExtras));
72: }
73:
74: /**
75: * @see br.com.igor.db.AbstractSQLParser#getUpdateSQL(java.lang.String, java.util.Map, java.util.ArrayList, java.util.ArrayList)
76: */
77: @Override
78: public ParsedPreparedStatement getUpdateSQL(String tableName,
79: Map data, ArrayList<String> columnsName,
80: ArrayList<String> pkNames) {
81: return parse(super .getUpdateSQL(tableName, data, columnsName,
82: pkNames));
83: }
84:
85: /**
86: * @see br.com.igor.db.SQLParser#parse(java.lang.String)
87: */
88: @Override
89: public ParsedPreparedStatement parse(ParsedPreparedStatement sql) {
90: sql.sql = sql.sql.replace(SQLParser.ENVOLVE_NOME_TABELA, ' ');
91: return sql;
92: }
93: }
|