diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/container/factory/SlicePropertiesBuilder.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/container/factory/SlicePropertiesBuilder.java index 8e659d4e7ee9ddc074cdeed52f95a368f9c6b239..b68784a3b721a12f61a4072e78843602660fc950 100644 --- a/o2server/x_base_core_project/src/main/java/com/x/base/core/container/factory/SlicePropertiesBuilder.java +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/container/factory/SlicePropertiesBuilder.java @@ -19,6 +19,7 @@ public class SlicePropertiesBuilder { public static String driver_gbase = "com.gbasedbt.jdbc.IfxDriver"; public static String driver_kingbase = "com.kingbase.Driver"; public static String driver_kingbase8 = "com.kingbase8.Driver"; + public static String driver_oscar = "com.oscar.Driver"; /* 避免db2在aix版本和lwl版本字段长度不一致的问题 */ public static String dictionary_db2 = "db2(createPrimaryKeys=false,characterColumnSize=255,maxColumnNameLength=128,maxIndexNameLength=128,maxConstraintNameLength=128)"; public static String dictionary_oracle = "oracle(maxTableNameLength=128,maxColumnNameLength=128,maxIndexNameLength=128,maxConstraintNameLength=128,maxEmbeddedClobSize=-1,maxEmbeddedBlobSize=-1)"; @@ -31,6 +32,7 @@ public class SlicePropertiesBuilder { public static String dictionary_gbase = "com.x.base.core.openjpa.jdbc.sql.GBaseDictionary"; public static String dictionary_kingbase = "com.x.base.core.openjpa.jdbc.sql.KingbaseDictionary"; public static String dictionary_kingbase8 = "com.x.base.core.openjpa.jdbc.sql.Kingbase8Dictionary"; + public static String dictionary_oscar = "com.x.base.core.openjpa.jdbc.sql.OscarDictionary"; public static String validationQuery_db2 = "select 1 from sysibm.sysdummy1"; public static String validationQuery_oracle = "select 1 from dual"; @@ -43,6 +45,7 @@ public class SlicePropertiesBuilder { public static String validationQuery_gbase = "select 1"; public static String validationQuery_kingbase = "select now()"; public static String validationQuery_kingbase8 = "select now()"; + public static String validationQuery_oscar = "select 1 from dual"; // 单个slice名称 public static String getName(Integer i) throws Exception { @@ -76,6 +79,8 @@ public class SlicePropertiesBuilder { return driver_kingbase; } else if (StringUtils.containsIgnoreCase(url, "jdbc:kingbase8:")) { return driver_kingbase8; + } else if (StringUtils.containsIgnoreCase(url, "jdbc:oscar:")) { + return driver_oscar; } throw new Exception("can not get driverClassName of url: " + url + "."); } @@ -103,6 +108,8 @@ public class SlicePropertiesBuilder { return dictionary_kingbase; } else if (StringUtils.containsIgnoreCase(url, "jdbc:kingbase8:")) { return dictionary_kingbase8; + } else if (StringUtils.containsIgnoreCase(url, "jdbc:oscar:")) { + return dictionary_oscar; } throw new Exception("can not get dictionary of url: " + url + "."); } @@ -130,6 +137,8 @@ public class SlicePropertiesBuilder { return true; } else if (StringUtils.containsIgnoreCase(url, "jdbc:kingbase8:")) { return true; + } else if (StringUtils.containsIgnoreCase(url, "jdbc:oscar:")) { + return true; } throw new Exception("can not get schema of url: " + url + "."); } @@ -157,6 +166,8 @@ public class SlicePropertiesBuilder { return validationQuery_kingbase; } else if (StringUtils.containsIgnoreCase(url, "jdbc:kingbase8:")) { return validationQuery_kingbase8; + } else if (StringUtils.containsIgnoreCase(url, "jdbc:oscar:")) { + return validationQuery_oscar; } throw new Exception("can not get schema of url: " + url + "."); } diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/openjpa/jdbc/sql/OscarDictionary.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/openjpa/jdbc/sql/OscarDictionary.java new file mode 100644 index 0000000000000000000000000000000000000000..538d2560d25cf5b15678571c9961e0d1a152034e --- /dev/null +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/openjpa/jdbc/sql/OscarDictionary.java @@ -0,0 +1,22 @@ +package com.x.base.core.openjpa.jdbc.sql; + +import org.apache.openjpa.jdbc.sql.DBDictionary; +import org.apache.openjpa.lib.util.Localizer; + +public class OscarDictionary extends DBDictionary { + + public static final String VENDOR_OSCAR = "Oscar"; + private static final Localizer _loc = Localizer.forPackage(OscarDictionary.class); + + public OscarDictionary() { + this.platform = VENDOR_OSCAR; + supportsDeferredConstraints = false; + maxTableNameLength = 128; + maxColumnNameLength = 128; + maxIndexNameLength = 128; + maxConstraintNameLength = 128; + maxEmbeddedClobSize = -1; + maxEmbeddedBlobSize = -1; + } + +}