01: /*
02: * Created by IntelliJ IDEA.
03: * User: sg426575
04: * Date: May 8, 2006
05: * Time: 1:32:52 AM
06: */
07: package com.technoetic.xplanner.upgrade.schema;
08:
09: /** @noinspection RefusedBequest*/
10: public class HsqldbDBDialect extends DBDialect {
11: public String getVendor() {
12: return "HSQL Database Engine";
13: }
14:
15: public String getAddForeignKeyConstraintQuery(String table,
16: String constraintName, String foreignKey,
17: String referencedTable, String referencedKey) {
18: return "alter table " + table + " add constraint "
19: + constraintName + " foreign key (" + foreignKey
20: + ") references " + referencedTable + " ("
21: + referencedKey + ")";
22: }
23:
24: public String getDropForeignKeyConstraintQuery(String table,
25: String constraintName) {
26: return "alter table " + table + " drop constraint "
27: + constraintName;
28: }
29:
30: public String getAddUniqueConstraintQuery(String table,
31: String constraintName, String column) {
32: return "alter table " + table + " add constraint "
33: + constraintName + " unique " + " ( " + column + " )";
34: }
35:
36: public String getRenameColumnQuery(String table, String oldName,
37: String newName, String type) {
38: return "alter table " + table + " alter column " + oldName
39: + " rename to " + newName;
40: }
41:
42: }
|