You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by sa...@apache.org on 2016/04/05 09:36:00 UTC
[7/7] ode git commit: ODE-1056: Custom postgreSQL dialect to mark
BLOB as BYTEA instead of OID
ODE-1056: Custom postgreSQL dialect to mark BLOB as BYTEA instead of OID
Project: http://git-wip-us.apache.org/repos/asf/ode/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/97c79724
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/97c79724
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/97c79724
Branch: refs/heads/ode-1.3.x
Commit: 97c797240ffc7ec917ae650f35796b0b16cc4ed9
Parents: 22e030c
Author: sathwik <sa...@apache.org>
Authored: Tue Apr 5 13:02:05 2016 +0530
Committer: sathwik <sa...@apache.org>
Committed: Tue Apr 5 13:02:05 2016 +0530
----------------------------------------------------------------------
.../src/main/sql/ode.postgres.properties | 2 +-
.../daohib/dialect/CustomDialectPostgreSQL.java | 32 ++++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ode/blob/97c79724/dao-hibernate-db/src/main/sql/ode.postgres.properties
----------------------------------------------------------------------
diff --git a/dao-hibernate-db/src/main/sql/ode.postgres.properties b/dao-hibernate-db/src/main/sql/ode.postgres.properties
index 9aa544c..af63366 100644
--- a/dao-hibernate-db/src/main/sql/ode.postgres.properties
+++ b/dao-hibernate-db/src/main/sql/ode.postgres.properties
@@ -31,7 +31,7 @@
#hibernate.dialect=org.hibernate.dialect.OracleDialect
#hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
#hibernate.dialect=org.hibernate.dialect.SQLServerDialect
-hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
+hibernate.dialect=org.apache.ode.daohib.dialect.CustomDialectPostgreSQL
#hibernate.dialect=org.hibernate.dialect.SybaseDialect
#Enable SQL-level debug logging (uncomment for logging)
http://git-wip-us.apache.org/repos/asf/ode/blob/97c79724/dao-hibernate/src/main/java/org/apache/ode/daohib/dialect/CustomDialectPostgreSQL.java
----------------------------------------------------------------------
diff --git a/dao-hibernate/src/main/java/org/apache/ode/daohib/dialect/CustomDialectPostgreSQL.java b/dao-hibernate/src/main/java/org/apache/ode/daohib/dialect/CustomDialectPostgreSQL.java
new file mode 100644
index 0000000..10be46b
--- /dev/null
+++ b/dao-hibernate/src/main/java/org/apache/ode/daohib/dialect/CustomDialectPostgreSQL.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.daohib.dialect;
+
+import java.sql.Types;
+
+import org.hibernate.dialect.PostgreSQLDialect;
+
+public class CustomDialectPostgreSQL extends PostgreSQLDialect {
+
+ public CustomDialectPostgreSQL() {
+ super();
+ registerColumnType( Types.BLOB, "bytea" );
+ }
+}