| 7 |
maesenka |
1 |
/**
|
| 16 |
maesenka |
2 |
* $Id: DialectProvider.java 244 2010-10-01 20:55:56Z maesenka $
|
| 7 |
maesenka |
3 |
*
|
| 56 |
maesenka |
4 |
* This file is part of Hibernate Spatial, an extension to the
|
| 22 |
maesenka |
5 |
* hibernate ORM solution for geographic data.
|
|
|
6 |
*
|
| 56 |
maesenka |
7 |
* Copyright © 2007 Geovise BVBA
|
| 22 |
maesenka |
8 |
* Copyright © 2007 K.U. Leuven LRD, Spatial Applications Division, Belgium
|
| 7 |
maesenka |
9 |
*
|
| 22 |
maesenka |
10 |
* This work was partially supported by the European Commission,
|
|
|
11 |
* under the 6th Framework Programme, contract IST-2-004688-STP.
|
| 56 |
maesenka |
12 |
*
|
| 22 |
maesenka |
13 |
* This library is free software; you can redistribute it and/or
|
|
|
14 |
* modify it under the terms of the GNU Lesser General Public
|
|
|
15 |
* License as published by the Free Software Foundation; either
|
|
|
16 |
* version 2.1 of the License, or (at your option) any later version.
|
| 7 |
maesenka |
17 |
*
|
| 22 |
maesenka |
18 |
* This library is distributed in the hope that it will be useful,
|
| 7 |
maesenka |
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 22 |
maesenka |
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
21 |
* Lesser General Public License for more details.
|
| 7 |
maesenka |
22 |
*
|
| 22 |
maesenka |
23 |
* You should have received a copy of the GNU Lesser General Public
|
|
|
24 |
* License along with this library; if not, write to the Free Software
|
|
|
25 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
26 |
*
|
| 56 |
maesenka |
27 |
* For more information, visit: http://www.hibernatespatial.org/
|
| 7 |
maesenka |
28 |
*/
|
| 40 |
maesenka |
29 |
package org.hibernatespatial.postgis;
|
| 7 |
maesenka |
30 |
|
| 40 |
maesenka |
31 |
import org.hibernatespatial.SpatialDialect;
|
|
|
32 |
import org.hibernatespatial.spi.SpatialDialectProvider;
|
| 7 |
maesenka |
33 |
|
|
|
34 |
/**
|
|
|
35 |
* PostGIS DialectProvider
|
| 22 |
maesenka |
36 |
*
|
|
|
37 |
* @author Karel Maesen
|
| 7 |
maesenka |
38 |
*/
|
|
|
39 |
public class DialectProvider implements SpatialDialectProvider {
|
|
|
40 |
|
| 56 |
maesenka |
41 |
/*
|
|
|
42 |
* (non-Javadoc)
|
|
|
43 |
*
|
|
|
44 |
* @see org.hibernatespatial.spi.SpatialDialectProvider#createSpatialDialect(java.lang.String,
|
|
|
45 |
* java.util.Map)
|
|
|
46 |
*/
|
| 73 |
maesenka |
47 |
public SpatialDialect createSpatialDialect(String dialect) {
|
| 56 |
maesenka |
48 |
if (dialect.equals(PostgisDialect.class.getCanonicalName())
|
|
|
49 |
|| dialect.equals("org.hibernate.dialect.PostgreSQLDialect")
|
|
|
50 |
|| dialect.equals("postgis"))
|
|
|
51 |
return new PostgisDialect();
|
|
|
52 |
else
|
|
|
53 |
return null;
|
|
|
54 |
}
|
| 7 |
maesenka |
55 |
|
| 56 |
maesenka |
56 |
/*
|
|
|
57 |
* (non-Javadoc)
|
|
|
58 |
*
|
|
|
59 |
* @see org.hibernatespatial.spi.SpatialDialectProvider#getDefaultDialect()
|
|
|
60 |
*/
|
|
|
61 |
public SpatialDialect getDefaultDialect() {
|
|
|
62 |
return new PostgisDialect();
|
|
|
63 |
}
|
| 7 |
maesenka |
64 |
|
| 56 |
maesenka |
65 |
/*
|
|
|
66 |
* (non-Javadoc)
|
|
|
67 |
*
|
|
|
68 |
* @see org.hibernatespatial.spi.SpatialDialectProvider#getSupportedDialects()
|
|
|
69 |
*/
|
|
|
70 |
public String[] getSupportedDialects() {
|
|
|
71 |
return new String[] { PostgisDialect.class.getCanonicalName() };
|
|
|
72 |
}
|
| 16 |
maesenka |
73 |
|
| 7 |
maesenka |
74 |
}
|