Revision 41509 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.db/org.gvsig.fmap.dal.db.jdbc/src/main/java/org/gvsig/fmap/dal/store/jdbc/JDBCNewStoreParameters.java

View differences:

JDBCNewStoreParameters.java
3 3
 *
4 4
 * Copyright (C) 2007-2013 gvSIG Association.
5 5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
6
 * This program is free software; you can redistribute it and/or modify it under
7
 * the terms of the GNU General Public License as published by the Free Software
8
 * Foundation; either version 3 of the License, or (at your option) any later
9
 * version.
10 10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU General Public License for more details.
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
 * details.
15 15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA 02110-1301, USA.
16
 * You should have received a copy of the GNU General Public License along with
17
 * this program; if not, write to the Free Software Foundation, Inc., 51
18
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 19
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
23 22
 */
24 23
package org.gvsig.fmap.dal.store.jdbc;
25 24

  
......
32 31
import static org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters.JDBC_DRIVER_CLASS_PARAMTER_NAME;
33 32
import static org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters.SCHEMA_PARAMTER_NAME;
34 33

  
35
public class JDBCNewStoreParameters extends DBNewStoreParameters implements 
34
public class JDBCNewStoreParameters extends DBNewStoreParameters implements
36 35
        JDBCConnectionParameters {
37 36

  
38 37
    public static final String PARAMETERS_DEFINITION_NAME = "JDBCNewStoreParameters";
......
97 96
        this.setDynValue(URL_PARAMTER_NAME, url);
98 97
    }
99 98

  
99
    /**
100
     * Return table <code>name</code> or <code>schema.tableName</code> if
101
     * <code>schema</code> parameter is set.
102
     *
103
     * @return
104
     */
105
    public String tableID() {
106
        if (this.getSchema() == null || this.getSchema() == "") {
107
            return escapeName(this.getTable());
108
        }
109
        return escapeName(this.getSchema()) + "." + escapeName(this.getTable());
110
    }
111

  
112
    protected String escapeName(String name) {
113
        return "\"".concat(name).concat("\"");
114
    }
115

  
100 116
}

Also available in: Unified diff