Statistics
| Revision:

svn-gvsig-desktop / 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 / jdbc2 / impl / JDBCStoreProviderFactoryBase.java @ 46563

History | View | Annotate | Download (3.54 KB)

1 43020 jjdelcerro
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
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
 *
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
 *
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.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.fmap.dal.store.jdbc2.impl;
24
25
import org.gvsig.fmap.dal.DataParameters;
26
import org.gvsig.fmap.dal.exception.InitializeException;
27
import org.gvsig.fmap.dal.feature.spi.AbstractFeatureStoreProviderFactory;
28
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
29
import org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters;
30
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters;
31 46542 fdiaz
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParametersBase;
32 43020 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper;
33 46542 fdiaz
import org.gvsig.fmap.dal.store.jdbc2.JDBCLibrary;
34 43020 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc2.JDBCStoreProvider;
35 46563 fdiaz
import org.gvsig.fmap.dal.store.jdbc2.JDBCStoreProviderFactory;
36 43020 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCHelperBase;
37
38 46542 fdiaz
public class JDBCStoreProviderFactoryBase
39
    extends AbstractFeatureStoreProviderFactory implements JDBCStoreProviderFactory
40 43020 jjdelcerro
    {
41
42
    private static final String NAME = JDBCLibrary.NAME;
43
44 45616 fdiaz
45 46542 fdiaz
    public JDBCStoreProviderFactoryBase() {
46 43020 jjdelcerro
        this(
47
                NAME,
48
                "JDBC generic store (2)"
49
        );
50
    }
51
52 43631 jjdelcerro
    @Override
53
    public int hasTabularSupport() {
54
        return YES;
55
    }
56 44191 jjdelcerro
57
    @Override
58
    public int hasSQLSupport() {
59
        return YES;
60
    }
61 43631 jjdelcerro
62 46542 fdiaz
    protected JDBCStoreProviderFactoryBase(String name, String description) {
63 43020 jjdelcerro
        super(name, description);
64
    }
65 43450 jjdelcerro
66 46542 fdiaz
    protected JDBCStoreProviderFactoryBase(String name, String description, boolean hidden) {
67 43450 jjdelcerro
        super(name, description, hidden);
68
    }
69 43020 jjdelcerro
70
    @Override
71
    public JDBCStoreProvider createProvider(
72
            DataParameters parameters,
73
            DataStoreProviderServices providerServices
74
    ) throws InitializeException {
75
        JDBCHelper helper = new JDBCHelperBase((JDBCConnectionParameters) parameters);
76 46542 fdiaz
        JDBCStoreProvider provider = helper.createProvider((JDBCStoreParameters) parameters,
77 43020 jjdelcerro
                providerServices
78
        );
79
        return provider;
80
    }
81
82
    @Override
83
    public JDBCStoreParameters createParameters() {
84 46542 fdiaz
        JDBCStoreParameters params = new JDBCStoreParametersBase(
85 43020 jjdelcerro
                NAME + "StoreParameters",
86
                NAME
87
        );
88
        return params;
89
    }
90
91 43708 jjdelcerro
    @Override
92
    public int isOptimalRecoverFeaturesByReference() {
93
        return NO;
94
    }
95
96 44039 jjdelcerro
    public int useLocalIndexesCanImprovePerformance() {
97
        return NO;
98
    }
99 43708 jjdelcerro
100 45008 omartinez
    @Override
101
    public boolean allowSpatialIndexSupport() {
102
        if (this.hasVectorialSupport() == YES) {
103
            return true;
104
        }
105
        return false;
106
    }
107 45616 fdiaz
108 46542 fdiaz
    @Override
109 45616 fdiaz
    public int caseIndentifierPreferedMode() {
110
        return CASE_IDENTIFIERS_UPPERCASE;
111
    }
112 43020 jjdelcerro
}