Hibernate SVN: r15882 - core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/sybase.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-02-03 22:56:19 -0500 (Tue, 03 Feb 2009)
New Revision: 15882
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml
Log:
HHH-3685 - Added workaround to unit test for creating Sybase stored procedures in chained transaction mode
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml
===================================================================
--- core/trunk/…
[View More]testsuite/src/test/java/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml 2009-02-04 03:39:17 UTC (rev 15881)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml 2009-02-04 03:56:19 UTC (rev 15882)
@@ -193,9 +193,19 @@
DROP PROCEDURE selectAllEmployments
</drop>
</database-object>
-
+
+ <!-- The following is a workaround for HHH-3685 so that SchemaExport -->
+ <!-- changes the transaction mode of selectAllEmployments to "chained" -->
<database-object>
<create>
+ sp_procxmode selectAllEmployments, 'chained'
+ </create>
+ <!-- no drop command corresponding to "sp_procxmode ..." -->
+ <drop/>
+ </database-object>
+
+ <database-object>
+ <create>
CREATE PROCEDURE paramHandling @j int, @i int AS
SELECT @j as value, @i as value2
</create>
@@ -204,8 +214,18 @@
</drop>
</database-object>
+ <!-- The following is a workaround for HHH-3685 so that SchemaExport -->
+ <!-- changes the transaction mode of paramHandling to "chained" -->
<database-object>
<create>
+ sp_procxmode paramHandling, 'chained'
+ </create>
+ <!-- no drop command corresponding to "sp_procxmode ..." -->
+ <drop/>
+ </database-object>
+
+ <database-object>
+ <create>
CREATE PROCEDURE simpleScalar @number int AS
SELECT @number as value, 'getAll' as name
</create>
@@ -214,4 +234,14 @@
</drop>
</database-object>
+ <!-- The following is a workaround for HHH-3685 so that SchemaExport -->
+ <!-- changes the transaction mode of simpleScalar to "chained" -->
+ <database-object>
+ <create>
+ sp_procxmode simpleScalar, 'chained'
+ </create>
+ <!-- no drop command corresponding to "sp_procxmode ..." -->
+ <drop/>
+ </database-object>
+
</hibernate-mapping>
[View Less]
16 years
Hibernate SVN: r15881 - in core/branches/Branch_3_3: testsuite/src/test/java/org/hibernate/test/interfaceproxy and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-02-03 22:39:17 -0500 (Tue, 03 Feb 2009)
New Revision: 15881
Modified:
core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java
core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SybaseDialect.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java
core/…
[View More]branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/lob/SerializableTypeTest.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/mixed/MixedTest.java
Log:
HHH-3691 : Sybase does not support Blobs and Clobs; skip unit tests that use Blobs/Clobs
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java 2009-02-04 03:36:37 UTC (rev 15880)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java 2009-02-04 03:39:17 UTC (rev 15881)
@@ -134,9 +134,9 @@
return false;
}
- public boolean supportsCascadeDelete() {
- return true;
- }
+ public boolean supportsCascadeDelete() {
+ return true;
+ }
public boolean supportsCircularCascadeDeleteConstraints() {
// SQL Server (at least up through 2005) does not support defining
@@ -145,6 +145,10 @@
return false;
}
+ public boolean supportsExpectedLobUsagePattern() {
+ return true;
+ }
+
public boolean supportsLobValueChangePropogation() {
// note: at least my local SQL Server 2005 Express shows this not working...
return false;
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SybaseDialect.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SybaseDialect.java 2009-02-04 03:36:37 UTC (rev 15880)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SybaseDialect.java 2009-02-04 03:39:17 UTC (rev 15881)
@@ -251,6 +251,10 @@
return false;
}
+ public boolean supportsExpectedLobUsagePattern() {
+ return false;
+ }
+
public boolean supportsEmptyInList() {
return false;
}
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java 2009-02-04 03:36:37 UTC (rev 15880)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java 2009-02-04 03:39:17 UTC (rev 15881)
@@ -6,7 +6,6 @@
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -33,8 +32,8 @@
public void testInterfaceProxies() {
- if ( getDialect() instanceof PostgreSQLDialect ) {
- // TODO : why?
+ if ( ! getDialect().supportsExpectedLobUsagePattern() ) {
+ reportSkip( "database/driver does not support expected LOB usage pattern", "LOB support" );
return;
}
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java 2009-02-04 03:36:37 UTC (rev 15880)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java 2009-02-04 03:39:17 UTC (rev 15881)
@@ -27,6 +27,7 @@
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.dialect.TimesTenDialect;
+import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -498,6 +499,14 @@
//s.refresh(b);
//assertTrue( b.getClob() instanceof ClobImpl );
s.flush();
+
+ // Sybase ASE does not support ResultSet.getBlob(String)
+ if ( getDialect() instanceof SybaseDialect && ! ( getDialect() instanceof SQLServerDialect ) ) {
+ s.connection().rollback();
+ s.close();
+ return;
+ }
+
s.refresh(b);
//b.getBlob().setBytes( 2, "abc".getBytes() );
b.getClob().getSubString(2, 3);
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/lob/SerializableTypeTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/lob/SerializableTypeTest.java 2009-02-04 03:36:37 UTC (rev 15880)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/lob/SerializableTypeTest.java 2009-02-04 03:39:17 UTC (rev 15881)
@@ -4,6 +4,9 @@
import junit.framework.Test;
import org.hibernate.Session;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.dialect.SybaseDialect;
+import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -26,11 +29,17 @@
return new FunctionalTestClassTestSuite( SerializableTypeTest.class );
}
+
public String getCacheConcurrencyStrategy() {
return null;
}
public void testNewSerializableType() {
+ // Sybase ASE does not support ResultSet.getBlob(String)
+ if ( getDialect() instanceof SybaseDialect && ! ( getDialect() instanceof SQLServerDialect ) ) {
+ return;
+ }
+
final String payloadText = "Initial payload";
Session s = openSession();
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/mixed/MixedTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/mixed/MixedTest.java 2009-02-04 03:36:37 UTC (rev 15880)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/mixed/MixedTest.java 2009-02-04 03:39:17 UTC (rev 15881)
@@ -6,7 +6,6 @@
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -57,7 +56,10 @@
t.commit();
s.close();
- if ( getDialect() instanceof PostgreSQLDialect ) return;
+ if ( ! getDialect().supportsExpectedLobUsagePattern() ) {
+ reportSkip( "database/driver does not support expected LOB usage pattern", "LOB support" );
+ return;
+ }
s = openSession( new DocumentInterceptor() );
t = s.beginTransaction();
[View Less]
16 years
Hibernate SVN: r15880 - core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/sybase.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-02-03 22:36:37 -0500 (Tue, 03 Feb 2009)
New Revision: 15880
Modified:
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml
Log:
HHH-3685 - Sybase - SchemaExport cannot create stored procedures in chained transaction mode
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml
===================================================================
--- …
[View More]core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml 2009-02-04 03:03:40 UTC (rev 15879)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml 2009-02-04 03:36:37 UTC (rev 15880)
@@ -193,9 +193,19 @@
DROP PROCEDURE selectAllEmployments
</drop>
</database-object>
-
+
+ <!-- The following is a workaround for HHH-3685 so that SchemaExport -->
+ <!-- changes the transaction mode of selectAllEmployments to "chained" -->
<database-object>
<create>
+ sp_procxmode selectAllEmployments, 'chained'
+ </create>
+ <!-- no drop command corresponding to "sp_procxmode ..." -->
+ <drop/>
+ </database-object>
+
+ <database-object>
+ <create>
CREATE PROCEDURE paramHandling @j int, @i int AS
SELECT @j as value, @i as value2
</create>
@@ -204,8 +214,18 @@
</drop>
</database-object>
+ <!-- The following is a workaround for HHH-3685 so that SchemaExport -->
+ <!-- changes the transaction mode of paramHandling to "chained" -->
<database-object>
<create>
+ sp_procxmode paramHandling, 'chained'
+ </create>
+ <!-- no drop command corresponding to "sp_procxmode ..." -->
+ <drop/>
+ </database-object>
+
+ <database-object>
+ <create>
CREATE PROCEDURE simpleScalar @number int AS
SELECT @number as value, 'getAll' as name
</create>
@@ -214,4 +234,14 @@
</drop>
</database-object>
+ <!-- The following is a workaround for HHH-3685 so that SchemaExport -->
+ <!-- changes the transaction mode of simpleScalar to "chained" -->
+ <database-object>
+ <create>
+ sp_procxmode simpleScalar, 'chained'
+ </create>
+ <!-- no drop command corresponding to "sp_procxmode ..." -->
+ <drop/>
+ </database-object>
+
</hibernate-mapping>
[View Less]
16 years
Hibernate SVN: r15879 - core/branches/Branch_3_2/test/org/hibernate/test/sql/hand/custom/sybase.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-02-03 22:03:40 -0500 (Tue, 03 Feb 2009)
New Revision: 15879
Modified:
core/branches/Branch_3_2/test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml
Log:
HHH-3685 : correct XML format
Modified: core/branches/Branch_3_2/test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml 2009-02-04 …
[View More]02:59:43 UTC (rev 15878)
+++ core/branches/Branch_3_2/test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml 2009-02-04 03:03:40 UTC (rev 15879)
@@ -236,7 +236,7 @@
<!-- The following is a workaround for HHH-3685 so that SchemaExport -->
<!-- changes the transaction mode of simpleScalar to "chained" -->
- <database-object>
+ <database-object>
<create>
sp_procxmode simpleScalar, 'chained'
</create>
[View Less]
16 years
Hibernate SVN: r15878 - core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/sql/hand/custom/sybase.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-02-03 21:59:43 -0500 (Tue, 03 Feb 2009)
New Revision: 15878
Modified:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml
Log:
JBPAPP-1546 HHH-3685 : corrected XML format
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/sql/hand/…
[View More]custom/sybase/Mappings.hbm.xml 2009-02-04 00:58:42 UTC (rev 15877)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml 2009-02-04 02:59:43 UTC (rev 15878)
@@ -236,7 +236,7 @@
<!-- The following is a workaround for HHH-3685 so that SchemaExport -->
<!-- changes the transaction mode of simpleScalar to "chained" -->
- <database-object>
+ <database-object>
<create>
sp_procxmode simpleScalar, 'chained'
</create>
[View Less]
16 years
Hibernate SVN: r15877 - in core/branches/Branch_3_2: test/org/hibernate/test/interfaceproxy and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-02-03 19:58:42 -0500 (Tue, 03 Feb 2009)
New Revision: 15877
Modified:
core/branches/Branch_3_2/src/org/hibernate/dialect/SQLServerDialect.java
core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseDialect.java
core/branches/Branch_3_2/test/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java
core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java
core/branches/Branch_3_2/test/org/hibernate/test/lob/SerializableTypeTest.…
[View More]java
core/branches/Branch_3_2/test/org/hibernate/test/mixed/MixedTest.java
Log:
HHH-3691 : Sybase does not support Blobs and Clobs; skip unit tests that use Blobs/Clobs
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/SQLServerDialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/SQLServerDialect.java 2009-02-04 00:50:58 UTC (rev 15876)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/SQLServerDialect.java 2009-02-04 00:58:42 UTC (rev 15877)
@@ -112,9 +112,9 @@
return false;
}
- public boolean supportsCascadeDelete() {
- return true;
- }
+ public boolean supportsCascadeDelete() {
+ return true;
+ }
public boolean supportsCircularCascadeDeleteConstraints() {
// SQL Server (at least up through 2005) does not support defining
@@ -123,6 +123,10 @@
return false;
}
+ public boolean supportsExpectedLobUsagePattern() {
+ return true;
+ }
+
public boolean supportsLobValueChangePropogation() {
// note: at least my local SQL Server 2005 Express shows this not working...
return false;
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseDialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseDialect.java 2009-02-04 00:50:58 UTC (rev 15876)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseDialect.java 2009-02-04 00:58:42 UTC (rev 15877)
@@ -228,6 +228,10 @@
return false;
}
+ public boolean supportsExpectedLobUsagePattern() {
+ return false;
+ }
+
public boolean supportsEmptyInList() {
return false;
}
Modified: core/branches/Branch_3_2/test/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java 2009-02-04 00:50:58 UTC (rev 15876)
+++ core/branches/Branch_3_2/test/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java 2009-02-04 00:58:42 UTC (rev 15877)
@@ -6,7 +6,6 @@
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -33,8 +32,8 @@
public void testInterfaceProxies() {
- if ( getDialect() instanceof PostgreSQLDialect ) {
- // TODO : why?
+ if ( ! getDialect().supportsExpectedLobUsagePattern() ) {
+ reportSkip( "database/driver does not support expected LOB usage pattern", "LOB support" );
return;
}
Modified: core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java 2009-02-04 00:50:58 UTC (rev 15876)
+++ core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java 2009-02-04 00:58:42 UTC (rev 15877)
@@ -25,6 +25,7 @@
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.dialect.TimesTenDialect;
+import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.Oracle9iDialect;
import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -496,6 +497,14 @@
//s.refresh(b);
//assertTrue( b.getClob() instanceof ClobImpl );
s.flush();
+
+ // Sybase ASE does not support ResultSet.getBlob(String)
+ if ( getDialect() instanceof SybaseDialect && ! ( getDialect() instanceof SQLServerDialect ) ) {
+ s.connection().rollback();
+ s.close();
+ return;
+ }
+
s.refresh(b);
//b.getBlob().setBytes( 2, "abc".getBytes() );
b.getClob().getSubString(2, 3);
Modified: core/branches/Branch_3_2/test/org/hibernate/test/lob/SerializableTypeTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/lob/SerializableTypeTest.java 2009-02-04 00:50:58 UTC (rev 15876)
+++ core/branches/Branch_3_2/test/org/hibernate/test/lob/SerializableTypeTest.java 2009-02-04 00:58:42 UTC (rev 15877)
@@ -28,6 +28,9 @@
import junit.framework.Test;
import org.hibernate.Session;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.dialect.SybaseDialect;
+import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -50,11 +53,17 @@
return new FunctionalTestClassTestSuite( SerializableTypeTest.class );
}
+
public String getCacheConcurrencyStrategy() {
return null;
}
public void testNewSerializableType() {
+ // Sybase ASE does not support ResultSet.getBlob(String)
+ if ( getDialect() instanceof SybaseDialect && ! ( getDialect() instanceof SQLServerDialect ) ) {
+ return;
+ }
+
final String payloadText = "Initial payload";
Session s = openSession();
Modified: core/branches/Branch_3_2/test/org/hibernate/test/mixed/MixedTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/mixed/MixedTest.java 2009-02-04 00:50:58 UTC (rev 15876)
+++ core/branches/Branch_3_2/test/org/hibernate/test/mixed/MixedTest.java 2009-02-04 00:58:42 UTC (rev 15877)
@@ -6,7 +6,6 @@
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -57,7 +56,10 @@
t.commit();
s.close();
- if ( getDialect() instanceof PostgreSQLDialect ) return;
+ if ( ! getDialect().supportsExpectedLobUsagePattern() ) {
+ reportSkip( "database/driver does not support expected LOB usage pattern", "LOB support" );
+ return;
+ }
s = openSession( new DocumentInterceptor() );
t = s.beginTransaction();
[View Less]
16 years
Hibernate SVN: r15876 - core/branches/Branch_3_2/test/org/hibernate/test/sql/hand/custom/sybase.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-02-03 19:50:58 -0500 (Tue, 03 Feb 2009)
New Revision: 15876
Modified:
core/branches/Branch_3_2/test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml
Log:
HHH-3685 - Added workaround to unit test for creating Sybase stored procedures in chained transaction mode
Modified: core/branches/Branch_3_2/test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml
===================================================================
--- core/branches/Branch_3_2/…
[View More]test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml 2009-02-03 23:25:10 UTC (rev 15875)
+++ core/branches/Branch_3_2/test/org/hibernate/test/sql/hand/custom/sybase/Mappings.hbm.xml 2009-02-04 00:50:58 UTC (rev 15876)
@@ -181,7 +181,7 @@
</return>
{ call selectAllEmployments() }
</sql-query>
-
+
<database-object>
<create>
CREATE PROCEDURE selectAllEmployments AS
@@ -194,8 +194,18 @@
</drop>
</database-object>
+ <!-- The following is a workaround for HHH-3685 so that SchemaExport -->
+ <!-- changes the transaction mode of selectAllEmployments to "chained" -->
<database-object>
<create>
+ sp_procxmode selectAllEmployments, 'chained'
+ </create>
+ <!-- no drop command corresponding to "sp_procxmode ..." -->
+ <drop/>
+ </database-object>
+
+ <database-object>
+ <create>
CREATE PROCEDURE paramHandling @j int, @i int AS
SELECT @j as value, @i as value2
</create>
@@ -203,9 +213,19 @@
DROP PROCEDURE paramHandling
</drop>
</database-object>
-
+
+ <!-- The following is a workaround for HHH-3685 so that SchemaExport -->
+ <!-- changes the transaction mode of paramHandling to "chained" -->
<database-object>
<create>
+ sp_procxmode paramHandling, 'chained'
+ </create>
+ <!-- no drop command corresponding to "sp_procxmode ..." -->
+ <drop/>
+ </database-object>
+
+ <database-object>
+ <create>
CREATE PROCEDURE simpleScalar @number int AS
SELECT @number as value, 'getAll' as name
</create>
@@ -213,5 +233,15 @@
DROP PROCEDURE simpleScalar
</drop>
</database-object>
-
+
+ <!-- The following is a workaround for HHH-3685 so that SchemaExport -->
+ <!-- changes the transaction mode of simpleScalar to "chained" -->
+ <database-object>
+ <create>
+ sp_procxmode simpleScalar, 'chained'
+ </create>
+ <!-- no drop command corresponding to "sp_procxmode ..." -->
+ <drop/>
+ </database-object>
+
</hibernate-mapping>
[View Less]
16 years
Hibernate SVN: r15875 - in validator/trunk: hibernate-validator/src/test/java/org/hibernate/validation/constraints/composition and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-02-03 18:25:10 -0500 (Tue, 03 Feb 2009)
New Revision: 15875
Added:
validator/trunk/validation-api/src/main/java/javax/validation/ReportAsSingleViolation.java
Removed:
validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromCompositeConstraint.java
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintDescriptorImpl.java
validator/trunk/hibernate-validator/src/main/java/org/…
[View More]hibernate/validation/engine/ConstraintTree.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/composition/GermanZipcode.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ConstraintCompositionTest.java
validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java
Log:
BVAL-112 rename @ReportAsViolationFromCompositeConstraint to @ReportAsSingleViolation
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintDescriptorImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintDescriptorImpl.java 2009-02-03 21:38:56 UTC (rev 15874)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintDescriptorImpl.java 2009-02-03 23:25:10 UTC (rev 15875)
@@ -33,7 +33,7 @@
import javax.validation.ConstraintValidator;
import javax.validation.OverridesParameter;
import javax.validation.OverridesParameters;
-import javax.validation.ReportAsViolationFromCompositeConstraint;
+import javax.validation.ReportAsSingleViolation;
import javax.validation.ValidationException;
import javax.validation.groups.Default;
@@ -112,7 +112,7 @@
this.builtinConstraints = builtinConstraints;
this.isReportAsSingleInvalidConstraint = annotation.annotationType().isAnnotationPresent(
- ReportAsViolationFromCompositeConstraint.class
+ ReportAsSingleViolation.class
);
@@ -169,7 +169,7 @@
/**
* {@inheritDoc}
*/
- public boolean isReportAsViolationFromCompositeConstraint() {
+ public boolean isReportAsSingleViolation() {
return isReportAsSingleInvalidConstraint;
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java 2009-02-03 21:38:56 UTC (rev 15874)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java 2009-02-03 23:25:10 UTC (rev 15875)
@@ -104,7 +104,7 @@
private boolean reportAsSingleViolation() {
return getParent() != null
- && getParent().getDescriptor().isReportAsViolationFromCompositeConstraint();
+ && getParent().getDescriptor().isReportAsSingleViolation();
}
private <T> void createConstraintViolation(Object value, Class<T> beanClass, ValidationContext<T> validationContext, Object leafBeanInstance, String message, ConstraintDescriptor descriptor) {
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/composition/GermanZipcode.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/composition/GermanZipcode.java 2009-02-03 21:38:56 UTC (rev 15874)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/composition/GermanZipcode.java 2009-02-03 23:25:10 UTC (rev 15875)
@@ -25,7 +25,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
import javax.validation.Constraint;
-import javax.validation.ReportAsViolationFromCompositeConstraint;
+import javax.validation.ReportAsSingleViolation;
/**
* Constraint used to test nested composing constraints.
@@ -37,7 +37,7 @@
@Documented
@Target({ METHOD, FIELD, TYPE })
@Retention(RUNTIME)
-@ReportAsViolationFromCompositeConstraint
+@ReportAsSingleViolation
public @interface GermanZipcode {
public abstract String message() default "Falsche Postnummer.";
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ConstraintCompositionTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ConstraintCompositionTest.java 2009-02-03 21:38:56 UTC (rev 15874)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ConstraintCompositionTest.java 2009-02-03 23:25:10 UTC (rev 15875)
@@ -164,7 +164,7 @@
address.setAddressline2( "3ter Stock" );
address.setCity( "Karlsruhe" );
address.setZipCode( "abc" );
- // actually three composing constraints fail, but due to @ReportAsViolationFromCompositeConstraint only one will be reported.
+ // actually three composing constraints fail, but due to @ReportAsSingleViolation only one will be reported.
Set<ConstraintViolation<GermanAddress>> constraintViolations = validator.validate( address );
assertNumberOfViolations( constraintViolations, 1 );
assertConstraintViolation(
Modified: validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java 2009-02-03 21:38:56 UTC (rev 15874)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java 2009-02-03 23:25:10 UTC (rev 15875)
@@ -74,7 +74,7 @@
Set<ConstraintDescriptor> getComposingConstraints();
/**
- * @return true if the constraint is annotated with @ReportAsViolationFromCompositeConstraint
+ * @return true if the constraint is annotated with @ReportAsSingleViolation
*/
- boolean isReportAsViolationFromCompositeConstraint();
+ boolean isReportAsSingleViolation();
}
\ No newline at end of file
Copied: validator/trunk/validation-api/src/main/java/javax/validation/ReportAsSingleViolation.java (from rev 15874, validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromCompositeConstraint.java)
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ReportAsSingleViolation.java (rev 0)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ReportAsSingleViolation.java 2009-02-03 23:25:10 UTC (rev 15875)
@@ -0,0 +1,35 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed 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 javax.validation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+
+/**
+ * A constraint annotation annotated with this annotation
+ * will return the composed annotation error report if any of the composing annotations
+ * fail. The error reports of each individual composing constraint is ignored.
+ *
+ * @author Emmanuel Bernard
+ */
+@Target({ ANNOTATION_TYPE })
+@Retention(RUNTIME)
+public @interface ReportAsSingleViolation {
+}
Property changes on: validator/trunk/validation-api/src/main/java/javax/validation/ReportAsSingleViolation.java
___________________________________________________________________
Name: svn:keywords
+ Id
Deleted: validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromCompositeConstraint.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromCompositeConstraint.java 2009-02-03 21:38:56 UTC (rev 15874)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromCompositeConstraint.java 2009-02-03 23:25:10 UTC (rev 15875)
@@ -1,35 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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 javax.validation;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * A constraint annotation annotated with this annotation
- * will return the composed annotation error report if any of the composing annotations
- * fail. The error reports of each individual composing constraint is ignored.
- *
- * @author Emmanuel Bernard
- */
-@Target({ ANNOTATION_TYPE })
-@Retention(RUNTIME)
-public @interface ReportAsViolationFromCompositeConstraint {
-}
[View Less]
16 years
Hibernate SVN: r15874 - core/branches/Branch_3_2/src/org/hibernate/hql/ast/tree.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-02-03 16:38:56 -0500 (Tue, 03 Feb 2009)
New Revision: 15874
Modified:
core/branches/Branch_3_2/src/org/hibernate/hql/ast/tree/DotNode.java
Log:
HHH-3749 : limit FromElement reuse
Modified: core/branches/Branch_3_2/src/org/hibernate/hql/ast/tree/DotNode.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/hql/ast/tree/DotNode.java 2009-02-03 21:38:29 UTC (rev 15873)
+++ core/…
[View More]branches/Branch_3_2/src/org/hibernate/hql/ast/tree/DotNode.java 2009-02-03 21:38:56 UTC (rev 15874)
@@ -5,9 +5,9 @@
import org.hibernate.engine.JoinSequence;
import org.hibernate.hql.CollectionProperties;
import org.hibernate.hql.antlr.SqlTokenTypes;
-import org.hibernate.hql.ast.util.ASTPrinter;
import org.hibernate.hql.ast.util.ASTUtil;
import org.hibernate.hql.ast.util.ColumnHelper;
+import org.hibernate.hql.ast.util.DisplayableNode;
import org.hibernate.persister.collection.QueryableCollection;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.sql.JoinFragment;
@@ -117,7 +117,7 @@
StringBuffer buf = new StringBuffer();
FromElement fromElement = getFromElement();
buf.append( "{propertyName=" ).append( propertyName );
- buf.append( ",dereferenceType=" ).append( ASTPrinter.getConstantName( getClass(), dereferenceType ) );
+ buf.append( ",dereferenceType=" ).append( getWalker().getASTPrinter().getTokenTypeName( dereferenceType ) );
buf.append( ",propertyPath=" ).append( propertyPath );
buf.append( ",path=" ).append( getPath() );
if ( fromElement != null ) {
@@ -412,10 +412,8 @@
///////////////////////////////////////////////////////////////////////////////
boolean found = elem != null;
- // even though we might find a pre-existing element by join path, for FromElements originating in a from-clause
- // we should only ever use the found element if the aliases match (null != null here). Implied joins are
- // always (?) ok to reuse.
- boolean useFoundFromElement = found && ( elem.isImplied() || areSame( classAlias, elem.getClassAlias() ) );
+ // even though we might find a pre-existing element by join path, we may not be able to reuse it...
+ boolean useFoundFromElement = found && canReuse( elem, classAlias );
if ( ! useFoundFromElement ) {
// If this is an implied join in a from element, then use the impled join type which is part of the
@@ -449,9 +447,28 @@
setFromElement( elem ); // This 'dot' expression now refers to the resulting from element.
}
+ private boolean canReuse(FromElement fromElement, String requestedAlias) {
+ // implicit joins are always(?) ok to reuse
+ if ( isImplicitJoin( fromElement ) ) {
+ return true;
+ }
+
+ // if the from-clauses are the same, we can be a little more aggressive in terms of what we reuse
+ if ( fromElement.getFromClause() == getWalker().getCurrentFromClause() ) {
+ return true;
+ }
+
+ // otherwise (subquery case) dont reuse the fromElement if we are processing the from-clause of the subquery
+ return getWalker().getCurrentClauseType() != SqlTokenTypes.FROM;
+ }
+
+ private boolean isImplicitJoin(FromElement fromElement) {
+ return fromElement.isImplied();
+ }
+
private boolean areSame(String alias1, String alias2) {
// again, null != null here
- return !StringHelper.isEmpty( alias1 ) && !StringHelper.isEmpty( alias2 ) && alias1.equals( alias2 );
+ return StringHelper.isNotEmpty( alias1 ) && StringHelper.isNotEmpty( alias2 ) && alias1.equals( alias2 );
}
private void setImpliedJoin(FromElement elem) {
[View Less]
16 years
Hibernate SVN: r15873 - core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/tree.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-02-03 16:38:29 -0500 (Tue, 03 Feb 2009)
New Revision: 15873
Modified:
core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/tree/DotNode.java
Log:
HHH-3749 : limit FromElement reuse
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/tree/DotNode.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/tree/DotNode.java 2009-…
[View More]02-03 20:49:00 UTC (rev 15872)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/tree/DotNode.java 2009-02-03 21:38:29 UTC (rev 15873)
@@ -28,7 +28,6 @@
import org.hibernate.engine.JoinSequence;
import org.hibernate.hql.CollectionProperties;
import org.hibernate.hql.antlr.SqlTokenTypes;
-import org.hibernate.hql.ast.util.ASTPrinter;
import org.hibernate.hql.ast.util.ASTUtil;
import org.hibernate.hql.ast.util.ColumnHelper;
import org.hibernate.persister.collection.QueryableCollection;
@@ -435,10 +434,8 @@
///////////////////////////////////////////////////////////////////////////////
boolean found = elem != null;
- // even though we might find a pre-existing element by join path, for FromElements originating in a from-clause
- // we should only ever use the found element if the aliases match (null != null here). Implied joins are
- // always (?) ok to reuse.
- boolean useFoundFromElement = found && ( elem.isImplied() || areSame( classAlias, elem.getClassAlias() ) );
+ // even though we might find a pre-existing element by join path, we may not be able to reuse it...
+ boolean useFoundFromElement = found && canReuse( elem, classAlias );
if ( ! useFoundFromElement ) {
// If this is an implied join in a from element, then use the impled join type which is part of the
@@ -472,9 +469,28 @@
setFromElement( elem ); // This 'dot' expression now refers to the resulting from element.
}
+ private boolean canReuse(FromElement fromElement, String requestedAlias) {
+ // implicit joins are always(?) ok to reuse
+ if ( isImplicitJoin( fromElement ) ) {
+ return true;
+ }
+
+ // if the from-clauses are the same, we can be a little more aggressive in terms of what we reuse
+ if ( fromElement.getFromClause() == getWalker().getCurrentFromClause() ) {
+ return true;
+ }
+
+ // otherwise (subquery case) dont reuse the fromElement if we are processing the from-clause of the subquery
+ return getWalker().getCurrentClauseType() != SqlTokenTypes.FROM;
+ }
+
+ private boolean isImplicitJoin(FromElement fromElement) {
+ return fromElement.isImplied();
+ }
+
private boolean areSame(String alias1, String alias2) {
// again, null != null here
- return !StringHelper.isEmpty( alias1 ) && !StringHelper.isEmpty( alias2 ) && alias1.equals( alias2 );
+ return StringHelper.isNotEmpty( alias1 ) && StringHelper.isNotEmpty( alias2 ) && alias1.equals( alias2 );
}
private void setImpliedJoin(FromElement elem) {
[View Less]
16 years