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 @ 47606

History | View | Annotate | Download (3.63 KB)

1
/**
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
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParametersBase;
32
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper;
33
import org.gvsig.fmap.dal.store.jdbc2.JDBCLibrary;
34
import org.gvsig.fmap.dal.store.jdbc2.JDBCStoreProvider;
35
import org.gvsig.fmap.dal.store.jdbc2.JDBCStoreProviderFactory;
36
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCHelperBase;
37

    
38
public class JDBCStoreProviderFactoryBase 
39
    extends AbstractFeatureStoreProviderFactory implements JDBCStoreProviderFactory 
40
    {
41

    
42
    private static final String NAME = JDBCLibrary.NAME;
43
    
44
    
45
    public JDBCStoreProviderFactoryBase() {
46
        this(
47
                NAME, 
48
                "JDBC generic store (2)"
49
        );
50
    }
51
    
52
    @Override
53
    public int hasTabularSupport() {
54
        return YES;
55
    }    
56

    
57
    @Override
58
    public int hasSQLSupport() {
59
        return YES;
60
    }
61
    
62
    protected JDBCStoreProviderFactoryBase(String name, String description) {
63
        super(name, description);
64
    }
65
    
66
    protected JDBCStoreProviderFactoryBase(String name, String description, boolean hidden) {
67
        super(name, description, hidden);
68
    }
69

    
70
    @Override
71
    public JDBCStoreProvider createProvider(
72
            DataParameters parameters,
73
            DataStoreProviderServices providerServices
74
    ) throws InitializeException {
75
        JDBCHelper helper = new JDBCHelperBase((JDBCConnectionParameters) parameters);
76
        JDBCStoreProvider provider = helper.createProvider((JDBCStoreParameters) parameters, 
77
                providerServices
78
        );
79
        return provider;
80
    }
81
    
82
    @Override
83
    public JDBCStoreParameters createParameters() {
84
        JDBCStoreParameters params = new JDBCStoreParametersBase(
85
                NAME + "StoreParameters",
86
                NAME 
87
        );
88
        return params;
89
    }
90

    
91
    @Override
92
    public int isOptimalRecoverFeaturesByReference() {
93
        return NO;
94
    }
95

    
96
    public int useLocalIndexesCanImprovePerformance() {
97
        return NO;
98
    }
99
    
100
    @Override
101
    public boolean allowSpatialIndexSupport() {
102
        if (this.hasVectorialSupport() != NO) {
103
            return true;
104
        }
105
        return false;
106
    }
107
    
108
    @Override
109
    public int caseIndentifierPreferedMode() {
110
        return CASE_IDENTIFIERS_UPPERCASE;
111
    }
112

    
113
    @Override
114
    public int supportPassthroughMode() {
115
        return YES;
116
    }
117
    
118
}