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 / JDBCStoreProviderFactory.java @ 45616

History | View | Annotate | Download (3.54 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.store.jdbc2.JDBCLibrary;
26

    
27
import org.gvsig.fmap.dal.DataParameters;
28
import org.gvsig.fmap.dal.exception.InitializeException;
29
import org.gvsig.fmap.dal.feature.spi.AbstractFeatureStoreProviderFactory;
30
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
31
import org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters;
32
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters;
33
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper;
34
import org.gvsig.fmap.dal.store.jdbc2.JDBCStoreProvider;
35
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCHelperBase;
36

    
37
public class JDBCStoreProviderFactory 
38
    extends AbstractFeatureStoreProviderFactory 
39
    {
40

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

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

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

    
94
    @Override
95
    public int isOptimalRecoverFeaturesByReference() {
96
        return NO;
97
    }
98

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