Mercurial > lada > lada-server
annotate src/main/java/de/intevation/lada/util/data/LadaPostgisDialect.java @ 1299:0eece233cbae
Added JSON object type to database dialect.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 24 Feb 2017 14:28:19 +0100 |
parents | 3ec358698b4d |
children |
rev | line source |
---|---|
711
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
2 * Software engineering by Intevation GmbH |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
3 * |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
7 */ |
673
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 package de.intevation.lada.util.data; |
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 |
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 import java.sql.Types; |
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 |
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 import org.hibernate.spatial.dialect.postgis.PostgisDialect; |
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 |
711
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
14 /** |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
15 * This dialect extends the default postgis dialect and registers a new data |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
16 * type for integer arrays. |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
17 * |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
18 * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
685
diff
changeset
|
19 */ |
673
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 public class LadaPostgisDialect extends PostgisDialect { |
685
3118fbbe6292
Fixed or supressed warnings.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
673
diff
changeset
|
21 private static final long serialVersionUID = 1L; |
3118fbbe6292
Fixed or supressed warnings.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
673
diff
changeset
|
22 |
673
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 public LadaPostgisDialect() { |
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 super(); |
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 this.registerColumnType(Types.ARRAY, "integer[]"); |
1299
0eece233cbae
Added JSON object type to database dialect.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
711
diff
changeset
|
26 this.registerColumnType(Types.JAVA_OBJECT, "json"); |
673
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 } |
e6564d5fdc7a
Use Postgis dialect to talk to the database.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 } |