Hibernate SVN: r14054 - core/branches/Branch_3_2/src/org/hibernate/cfg.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-03 01:44:20 -0400 (Wed, 03 Oct 2007)
New Revision: 14054
Modified:
core/branches/Branch_3_2/src/org/hibernate/cfg/HbmBinder.java
Log:
HHH-2861 : validation of delete-orphan for to-one association cascading
Modified: core/branches/Branch_3_2/src/org/hibernate/cfg/HbmBinder.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/cfg/HbmBinder.java 2007-10-03 04:55:03 UTC (rev 14053)
+++ core/branches/Branch_3_2/src/org/hibernate/cfg/HbmBinder.java 2007-10-03 05:44:20 UTC (rev 14054)
@@ -1567,9 +1567,9 @@
}
private static void validateCascade(Element node, String path) {
- String cascade = node.attributeValue("cascade");
- if ( cascade!=null && cascade.indexOf("delete-orphan")>0 ) {
- throw new MappingException("single-valued associations do not support orphan delete: " + path);
+ String cascade = node.attributeValue( "cascade" );
+ if ( cascade != null && cascade.indexOf( "delete-orphan" ) >= 0 ) {
+ throw new MappingException( "single-valued associations do not support orphan delete: " + path );
}
}
16 years, 6 months
Hibernate SVN: r14053 - in core/branches/Branch_3_2: test/org/hibernate/test/filter and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-03 00:55:03 -0400 (Wed, 03 Oct 2007)
New Revision: 14053
Modified:
core/branches/Branch_3_2/src/org/hibernate/sql/Template.java
core/branches/Branch_3_2/test/org/hibernate/test/filter/Category.hbm.xml
core/branches/Branch_3_2/test/org/hibernate/test/filter/DynamicFilterTest.java
core/branches/Branch_3_2/test/org/hibernate/test/filter/defs.hbm.xml
Log:
HHH-2593 : filter conditions using UNION (or MINUS) subqueries
Modified: core/branches/Branch_3_2/src/org/hibernate/sql/Template.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/sql/Template.java 2007-10-03 04:54:42 UTC (rev 14052)
+++ core/branches/Branch_3_2/src/org/hibernate/sql/Template.java 2007-10-03 04:55:03 UTC (rev 14053)
@@ -48,6 +48,8 @@
KEYWORDS.add("some");
KEYWORDS.add("exists");
KEYWORDS.add("all");
+ KEYWORDS.add("union");
+ KEYWORDS.add("minus");
BEFORE_TABLE_KEYWORDS.add("from");
BEFORE_TABLE_KEYWORDS.add("join");
Modified: core/branches/Branch_3_2/test/org/hibernate/test/filter/Category.hbm.xml
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/filter/Category.hbm.xml 2007-10-03 04:54:42 UTC (rev 14052)
+++ core/branches/Branch_3_2/test/org/hibernate/test/filter/Category.hbm.xml 2007-10-03 04:55:03 UTC (rev 14053)
@@ -6,21 +6,24 @@
<hibernate-mapping package="org.hibernate.test.filter">
<class name="Category" table="CATEGORY">
- <id name="id" column="CAT_ID" >
- <generator class="native"/>
- </id>
+ <id name="id" column="CAT_ID">
+ <generator class="native"/>
+ </id>
- <property name="name" type="string"/>
- <property name="effectiveStartDate" column="eff_start_dt" type="java.util.Date"/>
- <property name="effectiveEndDate" column="eff_end_dt" type="java.util.Date"/>
+ <property name="name" type="string"/>
+ <property name="effectiveStartDate" column="eff_start_dt" type="java.util.Date"/>
+ <property name="effectiveEndDate" column="eff_end_dt" type="java.util.Date"/>
- <set cascade="none" inverse="true" name="products" table="PROD_CAT">
- <key column="CAT_ID"/>
- <many-to-many column="PROD_ID" class="Product"/>
- </set>
+ <set cascade="none" inverse="true" name="products" table="PROD_CAT">
+ <key column="CAT_ID"/>
+ <many-to-many column="PROD_ID" class="Product"/>
+ </set>
- <filter name="effectiveDate" condition=":asOfDate BETWEEN eff_start_dt and eff_end_dt"/>
+ <filter name="effectiveDate" condition=":asOfDate BETWEEN eff_start_dt and eff_end_dt"/>
+ <filter name="unioned">
+ 'abc' in ( select d.reg from department d where (d.dept_id=123) union select p.name from sales_person p )
+ </filter>
- </class>
+ </class>
</hibernate-mapping>
\ No newline at end of file
Modified: core/branches/Branch_3_2/test/org/hibernate/test/filter/DynamicFilterTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/filter/DynamicFilterTest.java 2007-10-03 04:54:42 UTC (rev 14052)
+++ core/branches/Branch_3_2/test/org/hibernate/test/filter/DynamicFilterTest.java 2007-10-03 04:55:03 UTC (rev 14053)
@@ -67,6 +67,13 @@
return new FunctionalTestClassTestSuite( DynamicFilterTest.class );
}
+ public void testSqlSyntaxOfFiltersWithUnions() {
+ Session session = openSession();
+ session.enableFilter( "unioned" );
+ session.createQuery( "from Category" ).list();
+ session.close();
+ }
+
public void testSecondLevelCachedCollectionsFiltering() {
TestData testData = new TestData();
testData.prepare();
Modified: core/branches/Branch_3_2/test/org/hibernate/test/filter/defs.hbm.xml
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/filter/defs.hbm.xml 2007-10-03 04:54:42 UTC (rev 14052)
+++ core/branches/Branch_3_2/test/org/hibernate/test/filter/defs.hbm.xml 2007-10-03 04:55:03 UTC (rev 14053)
@@ -27,4 +27,8 @@
<filter-def name="cat">
<filter-param name="catId" type="long"/>
</filter-def>
+
+ <filter-def name="unioned">
+ </filter-def>
+
</hibernate-mapping>
\ No newline at end of file
16 years, 6 months
Hibernate SVN: r14052 - in core/trunk: testsuite/src/test/java/org/hibernate/test/filter and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-03 00:54:42 -0400 (Wed, 03 Oct 2007)
New Revision: 14052
Modified:
core/trunk/core/src/main/java/org/hibernate/sql/Template.java
core/trunk/testsuite/src/test/java/org/hibernate/test/filter/Category.hbm.xml
core/trunk/testsuite/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/filter/defs.hbm.xml
Log:
HHH-2593 : filter conditions using UNION (or MINUS) subqueries
Modified: core/trunk/core/src/main/java/org/hibernate/sql/Template.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/sql/Template.java 2007-10-03 03:51:13 UTC (rev 14051)
+++ core/trunk/core/src/main/java/org/hibernate/sql/Template.java 2007-10-03 04:54:42 UTC (rev 14052)
@@ -48,7 +48,9 @@
KEYWORDS.add("some");
KEYWORDS.add("exists");
KEYWORDS.add("all");
-
+ KEYWORDS.add("union");
+ KEYWORDS.add("minus");
+
BEFORE_TABLE_KEYWORDS.add("from");
BEFORE_TABLE_KEYWORDS.add("join");
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/filter/Category.hbm.xml
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/filter/Category.hbm.xml 2007-10-03 03:51:13 UTC (rev 14051)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/filter/Category.hbm.xml 2007-10-03 04:54:42 UTC (rev 14052)
@@ -6,21 +6,24 @@
<hibernate-mapping package="org.hibernate.test.filter">
<class name="Category" table="CATEGORY">
- <id name="id" column="CAT_ID" >
- <generator class="native"/>
- </id>
+ <id name="id" column="CAT_ID">
+ <generator class="native"/>
+ </id>
- <property name="name" type="string"/>
- <property name="effectiveStartDate" column="eff_start_dt" type="java.util.Date"/>
- <property name="effectiveEndDate" column="eff_end_dt" type="java.util.Date"/>
+ <property name="name" type="string"/>
+ <property name="effectiveStartDate" column="eff_start_dt" type="java.util.Date"/>
+ <property name="effectiveEndDate" column="eff_end_dt" type="java.util.Date"/>
- <set cascade="none" inverse="true" name="products" table="PROD_CAT">
- <key column="CAT_ID"/>
- <many-to-many column="PROD_ID" class="Product"/>
- </set>
+ <set cascade="none" inverse="true" name="products" table="PROD_CAT">
+ <key column="CAT_ID"/>
+ <many-to-many column="PROD_ID" class="Product"/>
+ </set>
- <filter name="effectiveDate" condition=":asOfDate BETWEEN eff_start_dt and eff_end_dt"/>
+ <filter name="effectiveDate" condition=":asOfDate BETWEEN eff_start_dt and eff_end_dt"/>
+ <filter name="unioned">
+ 'abc' in ( select d.reg from department d where (d.dept_id=123) union select p.name from sales_person p )
+ </filter>
- </class>
+ </class>
</hibernate-mapping>
\ No newline at end of file
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java 2007-10-03 03:51:13 UTC (rev 14051)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java 2007-10-03 04:54:42 UTC (rev 14052)
@@ -65,6 +65,13 @@
return new FunctionalTestClassTestSuite( DynamicFilterTest.class );
}
+ public void testSqlSyntaxOfFiltersWithUnions() {
+ Session session = openSession();
+ session.enableFilter( "unioned" );
+ session.createQuery( "from Category" ).list();
+ session.close();
+ }
+
public void testSecondLevelCachedCollectionsFiltering() {
TestData testData = new TestData();
testData.prepare();
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/filter/defs.hbm.xml
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/filter/defs.hbm.xml 2007-10-03 03:51:13 UTC (rev 14051)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/filter/defs.hbm.xml 2007-10-03 04:54:42 UTC (rev 14052)
@@ -27,4 +27,8 @@
<filter-def name="cat">
<filter-param name="catId" type="long"/>
</filter-def>
+
+ <filter-def name="unioned">
+ </filter-def>
+
</hibernate-mapping>
\ No newline at end of file
16 years, 6 months
Hibernate SVN: r14051 - in core/branches/Branch_3_2: test/org/hibernate/test/jpa/ql and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-02 23:51:13 -0400 (Tue, 02 Oct 2007)
New Revision: 14051
Modified:
core/branches/Branch_3_2/src/org/hibernate/hql/ast/tree/FromClause.java
core/branches/Branch_3_2/test/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java
Log:
HHH-2159 : NullPointerException in FromElement#findIntendedAliasedFromElementBasedOnCrazyJPARequirements
Modified: core/branches/Branch_3_2/src/org/hibernate/hql/ast/tree/FromClause.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/hql/ast/tree/FromClause.java 2007-10-03 03:50:47 UTC (rev 14050)
+++ core/branches/Branch_3_2/src/org/hibernate/hql/ast/tree/FromClause.java 2007-10-03 03:51:13 UTC (rev 14051)
@@ -85,13 +85,14 @@
}
void addDuplicateAlias(String alias, FromElement element) {
- fromElementByClassAlias.put( alias, element );
+ if ( alias != null ) {
+ fromElementByClassAlias.put( alias, element );
+ }
}
private void checkForDuplicateClassAlias(String classAlias) throws SemanticException {
if ( classAlias != null && fromElementByClassAlias.containsKey( classAlias ) ) {
- throw new SemanticException( "Duplicate definition of alias '"
- + classAlias + "'" );
+ throw new SemanticException( "Duplicate definition of alias '" + classAlias + "'" );
}
}
Modified: core/branches/Branch_3_2/test/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java 2007-10-03 03:50:47 UTC (rev 14050)
+++ core/branches/Branch_3_2/test/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java 2007-10-03 03:51:13 UTC (rev 14051)
@@ -41,6 +41,12 @@
s.close();
}
+ public void testIdentifierCasesensitivityAndDuplicateFromElements() throws Exception {
+ Session s = openSession();
+ s.createQuery( "select e from MyEntity e where exists (select 1 from MyEntity e2 where e2.other.name = 'something' and e2.other.other = e)" );
+ s.close();
+ }
+
public void testGeneratedSubquery() {
Session s = openSession();
s.createQuery( "select c FROM Item c WHERE c.parts IS EMPTY" ).list();
16 years, 6 months
Hibernate SVN: r14050 - in core/trunk: testsuite/src/test/java/org/hibernate/test/jpa/ql and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-02 23:50:47 -0400 (Tue, 02 Oct 2007)
New Revision: 14050
Modified:
core/trunk/core/src/main/java/org/hibernate/hql/ast/tree/FromClause.java
core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java
Log:
HHH-2159 : NullPointerException in FromElement#findIntendedAliasedFromElementBasedOnCrazyJPARequirements
Modified: core/trunk/core/src/main/java/org/hibernate/hql/ast/tree/FromClause.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/hql/ast/tree/FromClause.java 2007-10-03 03:09:52 UTC (rev 14049)
+++ core/trunk/core/src/main/java/org/hibernate/hql/ast/tree/FromClause.java 2007-10-03 03:50:47 UTC (rev 14050)
@@ -85,13 +85,14 @@
}
void addDuplicateAlias(String alias, FromElement element) {
- fromElementByClassAlias.put( alias, element );
+ if ( alias != null ) {
+ fromElementByClassAlias.put( alias, element );
+ }
}
private void checkForDuplicateClassAlias(String classAlias) throws SemanticException {
if ( classAlias != null && fromElementByClassAlias.containsKey( classAlias ) ) {
- throw new SemanticException( "Duplicate definition of alias '"
- + classAlias + "'" );
+ throw new SemanticException( "Duplicate definition of alias '" + classAlias + "'" );
}
}
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java 2007-10-03 03:09:52 UTC (rev 14049)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java 2007-10-03 03:50:47 UTC (rev 14050)
@@ -41,6 +41,12 @@
s.close();
}
+ public void testIdentifierCasesensitivityAndDuplicateFromElements() throws Exception {
+ Session s = openSession();
+ s.createQuery( "select e from MyEntity e where exists (select 1 from MyEntity e2 where e2.other.name = 'something' and e2.other.other = e)" );
+ s.close();
+ }
+
public void testGeneratedSubquery() {
Session s = openSession();
s.createQuery( "select c FROM Item c WHERE c.parts IS EMPTY" ).list();
16 years, 6 months
Hibernate SVN: r14049 - core/branches/Branch_3_2/src/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-02 23:09:52 -0400 (Tue, 02 Oct 2007)
New Revision: 14049
Modified:
core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java
Log:
HHH-2070: expanded DB2Dialect auto-discovery support
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java 2007-10-03 03:09:34 UTC (rev 14048)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java 2007-10-03 03:09:52 UTC (rev 14049)
@@ -109,22 +109,31 @@
}
}
+ // TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
private static final Map MAPPERS = new HashMap();
static {
- // TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
MAPPERS.put( "HSQL Database Engine", new VersionInsensitiveMapper( "org.hibernate.dialect.HSQLDialect" ) );
MAPPERS.put( "H2", new VersionInsensitiveMapper( "org.hibernate.dialect.H2Dialect" ) );
- MAPPERS.put( "DB2/NT", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
- MAPPERS.put( "DB2/LINUX", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
MAPPERS.put( "MySQL", new VersionInsensitiveMapper( "org.hibernate.dialect.MySQLDialect" ) );
MAPPERS.put( "PostgreSQL", new VersionInsensitiveMapper( "org.hibernate.dialect.PostgreSQLDialect" ) );
+ MAPPERS.put( "Apache Derby", new VersionInsensitiveMapper( "org.hibernate.dialect.DerbyDialect" ) );
+
MAPPERS.put( "Microsoft SQL Server Database", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
MAPPERS.put( "Microsoft SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
MAPPERS.put( "Sybase SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseDialect" ) );
MAPPERS.put( "Adaptive Server Enterprise", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseDialect" ) );
+
MAPPERS.put( "Informix Dynamic Server", new VersionInsensitiveMapper( "org.hibernate.dialect.InformixDialect" ) );
- MAPPERS.put( "Apache Derby", new VersionInsensitiveMapper( "org.hibernate.dialect.DerbyDialect" ) );
+ // thanks goodness for "universal" databases...
+ MAPPERS.put( "DB2/NT", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/LINUX", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/6000", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/HPUX", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/SUN", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/LINUX390", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/AIX64", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+
MAPPERS.put(
"Oracle",
new DatabaseDialectMapper() {
16 years, 6 months
Hibernate SVN: r14048 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-02 23:09:34 -0400 (Tue, 02 Oct 2007)
New Revision: 14048
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java
Log:
HHH-2070: expanded DB2Dialect auto-discovery support
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java 2007-10-03 02:57:00 UTC (rev 14047)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java 2007-10-03 03:09:34 UTC (rev 14048)
@@ -109,22 +109,31 @@
}
}
+ // TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
private static final Map MAPPERS = new HashMap();
static {
- // TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
MAPPERS.put( "HSQL Database Engine", new VersionInsensitiveMapper( "org.hibernate.dialect.HSQLDialect" ) );
MAPPERS.put( "H2", new VersionInsensitiveMapper( "org.hibernate.dialect.H2Dialect" ) );
- MAPPERS.put( "DB2/NT", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
- MAPPERS.put( "DB2/LINUX", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
MAPPERS.put( "MySQL", new VersionInsensitiveMapper( "org.hibernate.dialect.MySQLDialect" ) );
MAPPERS.put( "PostgreSQL", new VersionInsensitiveMapper( "org.hibernate.dialect.PostgreSQLDialect" ) );
+ MAPPERS.put( "Apache Derby", new VersionInsensitiveMapper( "org.hibernate.dialect.DerbyDialect" ) );
+
MAPPERS.put( "Microsoft SQL Server Database", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
MAPPERS.put( "Microsoft SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
MAPPERS.put( "Sybase SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseDialect" ) );
MAPPERS.put( "Adaptive Server Enterprise", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseDialect" ) );
+
MAPPERS.put( "Informix Dynamic Server", new VersionInsensitiveMapper( "org.hibernate.dialect.InformixDialect" ) );
- MAPPERS.put( "Apache Derby", new VersionInsensitiveMapper( "org.hibernate.dialect.DerbyDialect" ) );
+ // thanks goodness for "universal" databases...
+ MAPPERS.put( "DB2/NT", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/LINUX", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/6000", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/HPUX", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/SUN", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/LINUX390", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/AIX64", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+
MAPPERS.put(
"Oracle",
new DatabaseDialectMapper() {
16 years, 6 months
Hibernate SVN: r14047 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-02 22:57:00 -0400 (Tue, 02 Oct 2007)
New Revision: 14047
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java
Log:
HHH-2682 : H2 dialect auto-discovery support
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java 2007-10-03 02:56:43 UTC (rev 14046)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java 2007-10-03 02:57:00 UTC (rev 14047)
@@ -113,6 +113,7 @@
static {
// TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
MAPPERS.put( "HSQL Database Engine", new VersionInsensitiveMapper( "org.hibernate.dialect.HSQLDialect" ) );
+ MAPPERS.put( "H2", new VersionInsensitiveMapper( "org.hibernate.dialect.H2Dialect" ) );
MAPPERS.put( "DB2/NT", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
MAPPERS.put( "DB2/LINUX", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
MAPPERS.put( "MySQL", new VersionInsensitiveMapper( "org.hibernate.dialect.MySQLDialect" ) );
16 years, 6 months
Hibernate SVN: r14046 - core/branches/Branch_3_2/src/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-02 22:56:43 -0400 (Tue, 02 Oct 2007)
New Revision: 14046
Modified:
core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java
Log:
HHH-2682 : H2 dialect auto-discovery support
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java 2007-10-03 02:51:31 UTC (rev 14045)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java 2007-10-03 02:56:43 UTC (rev 14046)
@@ -113,6 +113,7 @@
static {
// TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
MAPPERS.put( "HSQL Database Engine", new VersionInsensitiveMapper( "org.hibernate.dialect.HSQLDialect" ) );
+ MAPPERS.put( "H2", new VersionInsensitiveMapper( "org.hibernate.dialect.H2Dialect" ) );
MAPPERS.put( "DB2/NT", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
MAPPERS.put( "DB2/LINUX", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
MAPPERS.put( "MySQL", new VersionInsensitiveMapper( "org.hibernate.dialect.MySQLDialect" ) );
16 years, 6 months
Hibernate SVN: r14045 - core/branches/Branch_3_2/src/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-02 22:51:31 -0400 (Tue, 02 Oct 2007)
New Revision: 14045
Modified:
core/branches/Branch_3_2/src/org/hibernate/dialect/HSQLDialect.java
Log:
HHH-2839 : HSQLDB and sequences
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/HSQLDialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/HSQLDialect.java 2007-10-03 02:50:59 UTC (rev 14044)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/HSQLDialect.java 2007-10-03 02:51:31 UTC (rev 14045)
@@ -9,7 +9,6 @@
import org.hibernate.LockMode;
import org.hibernate.StaleObjectStateException;
import org.hibernate.JDBCException;
-import org.hibernate.MappingException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.persister.entity.Lockable;
import org.hibernate.util.ReflectHelper;
@@ -203,31 +202,20 @@
return true;
}
- public String[] getCreateSequenceStrings(String sequenceName) {
- return getCreateSequenceStrings( sequenceName, 1, 1 );
+ protected String getCreateSequenceString(String sequenceName) {
+ return "create sequence " + sequenceName;
}
- public String[] getCreateSequenceStrings(String sequenceName, int initialValue, int incrementSize) {
- return new String[] {
- "create table dual_" + sequenceName + " (zero integer)",
- "insert into dual_" + sequenceName + " values (0)",
- "create sequence " + sequenceName + " start with " + initialValue + " increment by " + incrementSize
- };
+ protected String getDropSequenceString(String sequenceName) {
+ return "drop sequence " + sequenceName;
}
- public String[] getDropSequenceStrings(String sequenceName) {
- return new String[] {
- "drop table dual_" + sequenceName + " if exists",
- "drop sequence " + sequenceName
- };
- }
-
public String getSelectSequenceNextValString(String sequenceName) {
return "next value for " + sequenceName;
}
public String getSequenceNextValString(String sequenceName) {
- return "select next value for " + sequenceName + " from dual_" + sequenceName;
+ return "call next value for " + sequenceName;
}
public String getQuerySequencesString() {
16 years, 6 months