jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r331546 - in /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db: SimpleDbPersistenceManager.java mssql.ddl postgresql.ddl
Date Mon, 07 Nov 2005 16:48:31 GMT
Author: stefan
Date: Mon Nov  7 08:44:44 2005
New Revision: 331546

URL: http://svn.apache.org/viewcvs?rev=331546&view=rev
Log:
- added postgresql.ddl contributed by Javier Bermejo (with minor modifications)
- fixed SimpleDbPersistenceManager.checkSchema() issue w/postgresql reported by Javier Bermejo
- fixed incorrect mssql.ddl

Added:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/postgresql.ddl
Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/mssql.ddl

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java?rev=331546&r1=331545&r2=331546&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
Mon Nov  7 08:44:44 2005
@@ -52,6 +52,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.sql.DatabaseMetaData;
 
 /**
  * <code>SimpleDbPersistenceManager</code> is a generic JDBC-based
@@ -927,8 +928,14 @@
      * @throws Exception if an error occurs
      */
     protected void checkSchema() throws Exception {
-        ResultSet rs = con.getMetaData().getTables(null, null,
-                schemaObjectPrefix + "NODE", null);
+        DatabaseMetaData metaData = con.getMetaData();
+        String tableName = schemaObjectPrefix + "NODE";
+        if (metaData.storesLowerCaseIdentifiers()) {
+            tableName = tableName.toLowerCase();
+        } else if (metaData.storesUpperCaseIdentifiers()) {
+            tableName = tableName.toUpperCase();
+        }
+        ResultSet rs = metaData.getTables(null, null, tableName, null);
         boolean schemaExists;
         try {
             schemaExists = rs.next();

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/mssql.ddl
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/mssql.ddl?rev=331546&r1=331545&r2=331546&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/mssql.ddl
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/mssql.ddl
Mon Nov  7 08:44:44 2005
@@ -1,8 +1,8 @@
-create table ${schemaObjectPrefix}NODE (NODE_ID char(36) not null, NODE_DATA varbinary not
null)
+create table ${schemaObjectPrefix}NODE (NODE_ID char(36) not null, NODE_DATA image not null)
 create unique index ${schemaObjectPrefix}NODE_IDX on ${schemaObjectPrefix}NODE (NODE_ID)
-create table ${schemaObjectPrefix}PROP (PROP_ID varchar not null, PROP_DATA varbinary not
null)
+create table ${schemaObjectPrefix}PROP (PROP_ID varchar(1024) not null, PROP_DATA image not
null)
 create unique index ${schemaObjectPrefix}PROP_IDX on ${schemaObjectPrefix}PROP (PROP_ID)
-create table ${schemaObjectPrefix}REFS (NODE_ID char(36) not null, REFS_DATA varbinary not
null)
+create table ${schemaObjectPrefix}REFS (NODE_ID char(36) not null, REFS_DATA image not null)
 create unique index ${schemaObjectPrefix}REFS_IDX on ${schemaObjectPrefix}REFS (NODE_ID)
-create cached table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar not null, BINVAL_DATA
image not null)
+create table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar(1024) not null, BINVAL_DATA image
not null)
 create unique index ${schemaObjectPrefix}BINVAL_IDX on ${schemaObjectPrefix}BINVAL (BINVAL_ID)

Added: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/postgresql.ddl
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/postgresql.ddl?rev=331546&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/postgresql.ddl
(added)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/postgresql.ddl
Mon Nov  7 08:44:44 2005
@@ -0,0 +1,8 @@
+create table ${schemaObjectPrefix}NODE (NODE_ID char(36) not null, NODE_DATA bytea not null)
+create unique index ${schemaObjectPrefix}NODE_IDX on ${schemaObjectPrefix}NODE (NODE_ID)
+create table ${schemaObjectPrefix}PROP (PROP_ID varchar not null, PROP_DATA bytea not null)
+create unique index ${schemaObjectPrefix}PROP_IDX on ${schemaObjectPrefix}PROP (PROP_ID)
+create table ${schemaObjectPrefix}REFS (NODE_ID char(36) not null, REFS_DATA bytea not null)
+create unique index ${schemaObjectPrefix}REFS_IDX on ${schemaObjectPrefix}REFS (NODE_ID)
+create table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar not null, BINVAL_DATA bytea not
null)
+create unique index ${schemaObjectPrefix}BINVAL_IDX on ${schemaObjectPrefix}BINVAL (BINVAL_ID)
\ No newline at end of file



Mime
View raw message