Hibernate SVN: r15206 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-09-16 18:01:19 -0400 (Tue, 16 Sep 2008)
New Revision: 15206
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/DB2Dialect.java
Log:
HHH-3483 : DB2 does not support position queries on TYPE_FORWARD_ONLY ResultSets
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/DB2Dialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/DB2Dialect.java 2008-09-16 21:36:35 UTC (rev 15205)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/DB2Dialect.java 2008-09-16 22:01:19 UTC (rev 15206)
@@ -380,6 +380,10 @@
return false;
}
+ public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
+ return false;
+ }
+
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public boolean supportsEmptyInList() {
16 years, 3 months
Hibernate SVN: r15205 - core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-09-16 17:36:35 -0400 (Tue, 16 Sep 2008)
New Revision: 15205
Modified:
core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/DB2Dialect.java
Log:
HHH-3483 : DB2 does not support position queries on TYPE_FORWARD_ONLY ResultSets
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/DB2Dialect.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/DB2Dialect.java 2008-09-16 20:23:49 UTC (rev 15204)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/DB2Dialect.java 2008-09-16 21:36:35 UTC (rev 15205)
@@ -380,6 +380,10 @@
return false;
}
+ public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
+ return false;
+ }
+
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public boolean supportsEmptyInList() {
16 years, 3 months
Hibernate SVN: r15204 - core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-09-16 16:23:49 -0400 (Tue, 16 Sep 2008)
New Revision: 15204
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/dialect/DB2Dialect.java
Log:
JBPAPP-950,HHH-3483 : DB2 does not support position queries on TYPE_FORWARD_ONLY ResultSets
Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/dialect/DB2Dialect.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/dialect/DB2Dialect.java 2008-09-16 20:22:22 UTC (rev 15203)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/dialect/DB2Dialect.java 2008-09-16 20:23:49 UTC (rev 15204)
@@ -357,6 +357,10 @@
return false;
}
+ public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
+ return false;
+ }
+
public String getCurrentTimestampSQLFunctionName() {
return "sysdate";
}
@@ -367,7 +371,7 @@
return false;
}
- public boolean supportsLobValueChangePropogation() {
- return false;
+ public boolean supportsLobValueChangePropogation() {
+ return false;
}
-}
\ No newline at end of file
+}
16 years, 3 months
Hibernate SVN: r15203 - core/branches/Branch_3_2/src/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-09-16 16:22:22 -0400 (Tue, 16 Sep 2008)
New Revision: 15203
Modified:
core/branches/Branch_3_2/src/org/hibernate/dialect/DB2Dialect.java
Log:
HHH-3483 : DB2 does not support position queries on TYPE_FORWARD_ONLY ResultSets
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/DB2Dialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/DB2Dialect.java 2008-09-16 15:59:40 UTC (rev 15202)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/DB2Dialect.java 2008-09-16 20:22:22 UTC (rev 15203)
@@ -357,6 +357,10 @@
return false;
}
+ public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
+ return false;
+ }
+
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public boolean supportsEmptyInList() {
16 years, 3 months
Hibernate SVN: r15202 - core/branches/Branch_3_2/src/org/hibernate/engine/query.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-09-16 11:59:40 -0400 (Tue, 16 Sep 2008)
New Revision: 15202
Modified:
core/branches/Branch_3_2/src/org/hibernate/engine/query/ParameterParser.java
Log:
HHH-3216 : ParameterParser + escaped function call syntax
Modified: core/branches/Branch_3_2/src/org/hibernate/engine/query/ParameterParser.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/engine/query/ParameterParser.java 2008-09-16 15:58:53 UTC (rev 15201)
+++ core/branches/Branch_3_2/src/org/hibernate/engine/query/ParameterParser.java 2008-09-16 15:59:40 UTC (rev 15202)
@@ -10,7 +10,7 @@
* named, JPA-style, or ordinal) and providing callbacks about such
* recognitions.
*
- * @author <a href="mailto:steve@hibernate.org">Steve Ebersole </a>
+ * @author Steve Ebersole
*/
public class ParameterParser {
@@ -22,8 +22,10 @@
public void other(char character);
}
+ /**
+ * Direct instantiation of ParameterParser disallowed.
+ */
private ParameterParser() {
- // disallow instantiation
}
/**
@@ -36,12 +38,10 @@
*
* @param sqlString The string to be parsed/tokenized.
* @param recognizer The thing which handles recognition events.
- * @throws QueryException
+ * @throws QueryException Indicates unexpected parameter conditions.
*/
public static void parse(String sqlString, Recognizer recognizer) throws QueryException {
- boolean hasMainOutputParameter = sqlString.indexOf( "call" ) > 0 &&
- sqlString.indexOf( "?" ) < sqlString.indexOf( "call" ) &&
- sqlString.indexOf( "=" ) < sqlString.indexOf( "call" );
+ boolean hasMainOutputParameter = startsWithEscapeCallTemplate( sqlString );
boolean foundMainOutputParam = false;
int stringLength = sqlString.length();
@@ -65,8 +65,9 @@
int chopLocation = right < 0 ? sqlString.length() : right;
String param = sqlString.substring( indx + 1, chopLocation );
if ( StringHelper.isEmpty( param ) ) {
- throw new QueryException("Space is not allowed after parameter prefix ':' '"
- + sqlString + "'");
+ throw new QueryException(
+ "Space is not allowed after parameter prefix ':' [" + sqlString + "]"
+ );
}
recognizer.namedParameter( param, indx );
indx = chopLocation - 1;
@@ -105,4 +106,34 @@
}
}
+ public static boolean startsWithEscapeCallTemplate(String sqlString) {
+ if ( ! ( sqlString.startsWith( "{" ) && sqlString.endsWith( "}" ) ) ) {
+ return false;
+ }
+
+ int chopLocation = sqlString.indexOf( "call" );
+ if ( chopLocation <= 0 ) {
+ return false;
+ }
+
+ final String checkString = sqlString.substring( 1, chopLocation + 4 );
+ final String fixture = "?=call";
+ int fixturePosition = 0;
+ boolean matches = true;
+ for ( int i = 0, max = checkString.length(); i < max; i++ ) {
+ final char c = Character.toLowerCase( checkString.charAt( i ) );
+ if ( Character.isWhitespace( c ) ) {
+ continue;
+ }
+ if ( c == fixture.charAt( fixturePosition ) ) {
+ fixturePosition++;
+ continue;
+ }
+ matches = false;
+ break;
+ }
+
+ return matches;
+ }
+
}
16 years, 3 months
Hibernate SVN: r15201 - in core/branches/Branch_3_3/core/src: test/java/org/hibernate and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-09-16 11:58:53 -0400 (Tue, 16 Sep 2008)
New Revision: 15201
Added:
core/branches/Branch_3_3/core/src/test/java/org/hibernate/engine/
core/branches/Branch_3_3/core/src/test/java/org/hibernate/engine/query/
core/branches/Branch_3_3/core/src/test/java/org/hibernate/engine/query/ParameterParserTest.java
Modified:
core/branches/Branch_3_3/core/src/main/java/org/hibernate/engine/query/ParameterParser.java
Log:
HHH-3216 : ParameterParser + escaped function call syntax
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/engine/query/ParameterParser.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/engine/query/ParameterParser.java 2008-09-16 15:57:19 UTC (rev 15200)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/engine/query/ParameterParser.java 2008-09-16 15:58:53 UTC (rev 15201)
@@ -46,8 +46,10 @@
public void other(char character);
}
+ /**
+ * Direct instantiation of ParameterParser disallowed.
+ */
private ParameterParser() {
- // disallow instantiation
}
/**
@@ -60,12 +62,10 @@
*
* @param sqlString The string to be parsed/tokenized.
* @param recognizer The thing which handles recognition events.
- * @throws QueryException
+ * @throws QueryException Indicates unexpected parameter conditions.
*/
public static void parse(String sqlString, Recognizer recognizer) throws QueryException {
- boolean hasMainOutputParameter = sqlString.indexOf( "call" ) > 0 &&
- sqlString.indexOf( "?" ) < sqlString.indexOf( "call" ) &&
- sqlString.indexOf( "=" ) < sqlString.indexOf( "call" );
+ boolean hasMainOutputParameter = startsWithEscapeCallTemplate( sqlString );
boolean foundMainOutputParam = false;
int stringLength = sqlString.length();
@@ -89,8 +89,9 @@
int chopLocation = right < 0 ? sqlString.length() : right;
String param = sqlString.substring( indx + 1, chopLocation );
if ( StringHelper.isEmpty( param ) ) {
- throw new QueryException("Space is not allowed after parameter prefix ':' '"
- + sqlString + "'");
+ throw new QueryException(
+ "Space is not allowed after parameter prefix ':' [" + sqlString + "]"
+ );
}
recognizer.namedParameter( param, indx );
indx = chopLocation - 1;
@@ -129,4 +130,34 @@
}
}
+ public static boolean startsWithEscapeCallTemplate(String sqlString) {
+ if ( ! ( sqlString.startsWith( "{" ) && sqlString.endsWith( "}" ) ) ) {
+ return false;
+ }
+
+ int chopLocation = sqlString.indexOf( "call" );
+ if ( chopLocation <= 0 ) {
+ return false;
+ }
+
+ final String checkString = sqlString.substring( 1, chopLocation + 4 );
+ final String fixture = "?=call";
+ int fixturePosition = 0;
+ boolean matches = true;
+ for ( int i = 0, max = checkString.length(); i < max; i++ ) {
+ final char c = Character.toLowerCase( checkString.charAt( i ) );
+ if ( Character.isWhitespace( c ) ) {
+ continue;
+ }
+ if ( c == fixture.charAt( fixturePosition ) ) {
+ fixturePosition++;
+ continue;
+ }
+ matches = false;
+ break;
+ }
+
+ return matches;
+ }
+
}
Added: core/branches/Branch_3_3/core/src/test/java/org/hibernate/engine/query/ParameterParserTest.java
===================================================================
--- core/branches/Branch_3_3/core/src/test/java/org/hibernate/engine/query/ParameterParserTest.java (rev 0)
+++ core/branches/Branch_3_3/core/src/test/java/org/hibernate/engine/query/ParameterParserTest.java 2008-09-16 15:58:53 UTC (rev 15201)
@@ -0,0 +1,39 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.engine.query;
+
+import junit.framework.TestCase;
+
+/**
+ * Unit tests of the ParameterParser class
+ *
+ * @author Steve Ebersole
+ */
+public class ParameterParserTest extends TestCase {
+ public void testEscapeCallRecognition() {
+ assertTrue( ParameterParser.startsWithEscapeCallTemplate( "{ ? = call abc(?) }" ) );
+ assertFalse( ParameterParser.startsWithEscapeCallTemplate( "from User u where u.userName = ? and u.userType = 'call'" ) );
+ }
+}
16 years, 3 months
Hibernate SVN: r15200 - in core/trunk/core/src: test/java/org/hibernate and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-09-16 11:57:19 -0400 (Tue, 16 Sep 2008)
New Revision: 15200
Added:
core/trunk/core/src/test/java/org/hibernate/engine/
core/trunk/core/src/test/java/org/hibernate/engine/query/
core/trunk/core/src/test/java/org/hibernate/engine/query/ParameterParserTest.java
Modified:
core/trunk/core/src/main/java/org/hibernate/engine/query/ParameterParser.java
Log:
HHH-3216 : ParameterParser + escaped function call syntax
Modified: core/trunk/core/src/main/java/org/hibernate/engine/query/ParameterParser.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/query/ParameterParser.java 2008-09-16 09:08:18 UTC (rev 15199)
+++ core/trunk/core/src/main/java/org/hibernate/engine/query/ParameterParser.java 2008-09-16 15:57:19 UTC (rev 15200)
@@ -46,8 +46,10 @@
public void other(char character);
}
+ /**
+ * Direct instantiation of ParameterParser disallowed.
+ */
private ParameterParser() {
- // disallow instantiation
}
/**
@@ -60,12 +62,10 @@
*
* @param sqlString The string to be parsed/tokenized.
* @param recognizer The thing which handles recognition events.
- * @throws QueryException
+ * @throws QueryException Indicates unexpected parameter conditions.
*/
public static void parse(String sqlString, Recognizer recognizer) throws QueryException {
- boolean hasMainOutputParameter = sqlString.indexOf( "call" ) > 0 &&
- sqlString.indexOf( "?" ) < sqlString.indexOf( "call" ) &&
- sqlString.indexOf( "=" ) < sqlString.indexOf( "call" );
+ boolean hasMainOutputParameter = startsWithEscapeCallTemplate( sqlString );
boolean foundMainOutputParam = false;
int stringLength = sqlString.length();
@@ -89,8 +89,9 @@
int chopLocation = right < 0 ? sqlString.length() : right;
String param = sqlString.substring( indx + 1, chopLocation );
if ( StringHelper.isEmpty( param ) ) {
- throw new QueryException("Space is not allowed after parameter prefix ':' '"
- + sqlString + "'");
+ throw new QueryException(
+ "Space is not allowed after parameter prefix ':' [" + sqlString + "]"
+ );
}
recognizer.namedParameter( param, indx );
indx = chopLocation - 1;
@@ -129,4 +130,34 @@
}
}
+ public static boolean startsWithEscapeCallTemplate(String sqlString) {
+ if ( ! ( sqlString.startsWith( "{" ) && sqlString.endsWith( "}" ) ) ) {
+ return false;
+ }
+
+ int chopLocation = sqlString.indexOf( "call" );
+ if ( chopLocation <= 0 ) {
+ return false;
+ }
+
+ final String checkString = sqlString.substring( 1, chopLocation + 4 );
+ final String fixture = "?=call";
+ int fixturePosition = 0;
+ boolean matches = true;
+ for ( int i = 0, max = checkString.length(); i < max; i++ ) {
+ final char c = Character.toLowerCase( checkString.charAt( i ) );
+ if ( Character.isWhitespace( c ) ) {
+ continue;
+ }
+ if ( c == fixture.charAt( fixturePosition ) ) {
+ fixturePosition++;
+ continue;
+ }
+ matches = false;
+ break;
+ }
+
+ return matches;
+ }
+
}
Added: core/trunk/core/src/test/java/org/hibernate/engine/query/ParameterParserTest.java
===================================================================
--- core/trunk/core/src/test/java/org/hibernate/engine/query/ParameterParserTest.java (rev 0)
+++ core/trunk/core/src/test/java/org/hibernate/engine/query/ParameterParserTest.java 2008-09-16 15:57:19 UTC (rev 15200)
@@ -0,0 +1,39 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.engine.query;
+
+import junit.framework.TestCase;
+
+/**
+ * Unit tests of the ParameterParser class
+ *
+ * @author Steve Ebersole
+ */
+public class ParameterParserTest extends TestCase {
+ public void testEscapeCallRecognition() {
+ assertTrue( ParameterParser.startsWithEscapeCallTemplate( "{ ? = call abc(?) }" ) );
+ assertFalse( ParameterParser.startsWithEscapeCallTemplate( "from User u where u.userName = ? and u.userType = 'call'" ) );
+ }
+}
16 years, 3 months
Hibernate SVN: r15199 - core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool.
by hibernate-commits@lists.jboss.org
Author: anthonyHib
Date: 2008-09-16 05:08:18 -0400 (Tue, 16 Sep 2008)
New Revision: 15199
Added:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TeamView.hbm.xml
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TeamView.java
Modified:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TestSchemaTools.java
Log:
JBPAPP-965 unitest
Added: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TeamView.hbm.xml
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TeamView.hbm.xml (rev 0)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TeamView.hbm.xml 2008-09-16 09:08:18 UTC (rev 15199)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.hibernate.test.tool">
+
+
+ <class name="TeamView" table="`TeamView`">
+ <id name="id" column="`iD`">
+ <generator class="native">
+ <param name="sequence">TEAM_SEQ</param>
+ </generator>
+ </id>
+ <property name="name"/>
+ <property name="duplicatedName"/>
+ </class>
+
+</hibernate-mapping>
Added: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TeamView.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TeamView.java (rev 0)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TeamView.java 2008-09-16 09:08:18 UTC (rev 15199)
@@ -0,0 +1,27 @@
+package org.hibernate.test.tool;
+
+
+public class TeamView {
+ private Long id;
+ private String name;
+ private String duplicatedName;
+ public Long getId() {
+ return id;
+ }
+ public void setId(Long id) {
+ this.id = id;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getDuplicatedName() {
+ return duplicatedName;
+ }
+ public void setDuplicatedName(String duplicatedName) {
+ this.duplicatedName = duplicatedName;
+ }
+
+}
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TestSchemaTools.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TestSchemaTools.java 2008-09-15 21:16:40 UTC (rev 15198)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/tool/TestSchemaTools.java 2008-09-16 09:08:18 UTC (rev 15199)
@@ -35,7 +35,7 @@
}
public String[] getMappings() {
- return new String[] { "tool/Team.hbm.xml" };
+ return new String[] { "tool/Team.hbm.xml", "tool/TeamView.hbm.xml" };
}
public boolean createSchema() {
@@ -115,6 +115,44 @@
session.close();
}
+ public void testViewValidation() throws Exception{
+ // database schema have been created thanks to the setUp method
+ // we have 2 schemas SA et SB, SB must be set as the default schema
+ // used by hibernate hibernate.default_schema SB
+ SchemaExport se = new SchemaExport(getCfg());
+ se.create(true,true);
+
+ // here we drop the table generated for TeamView and create a view in order to test View validation
+ Session session = openSession();
+ Connection conn = session.connection();
+ Statement stat = conn.createStatement();
+ stat.execute("DROP TABLE \"SB\".\"TeamView\" ");
+ stat.execute("CREATE VIEW \"SB\".\"TeamView\" AS SELECT \"iD\",name, name as duplicatedname FROM \"SB\".\"Team\"");
+
+
+ // update schema, here should do nothing
+ SchemaUpdate su = new SchemaUpdate(getCfg());
+ su.execute(true,true);
+
+ // we can run schema validation.
+ // if schema validator chooses the bad db schema, then the testcase will fail (exception)
+ SchemaValidator sv = new SchemaValidator(getCfg());
+ sv.validate();
+
+ // it's time to clean our database
+ se.drop(true,true);
+
+ // then the schemas and false table.
+
+ stat.execute("DROP TABLE \"SA\".\"Team\" ");
+ stat.execute(" DROP SCHEMA sa ");
+ stat.execute("DROP VIEW \"SB\".\"TeamView\" ");
+ stat.execute("DROP TABLE \"SB\".\"Team\" ");
+ stat.execute("DROP SCHEMA sb ");
+ stat.close();
+ session.close();
+ }
+
public void testSchemaToolsNonQuote() throws Exception{
// database schema have been created thanks to the setUp method
// we have 2 schemas SA et SB, SB must be set as the default schema
16 years, 3 months
Hibernate SVN: r15198 - core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/tool/hbm2ddl.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-09-15 17:16:40 -0400 (Mon, 15 Sep 2008)
New Revision: 15198
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/tool/hbm2ddl/DatabaseMetadata.java
Log:
JBPAPP-965,HHH-1329 : SchemaValidator fail when views are involved
Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/tool/hbm2ddl/DatabaseMetadata.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/tool/hbm2ddl/DatabaseMetadata.java 2008-09-15 03:59:11 UTC (rev 15197)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/tool/hbm2ddl/DatabaseMetadata.java 2008-09-15 21:16:40 UTC (rev 15198)
@@ -46,7 +46,7 @@
initSequences(connection, dialect);
}
- private static final String[] TYPES = {"TABLE"};
+ private static final String[] TYPES = {"TABLE", "VIEW"};
public TableMetadata getTableMetadata(String name, String schema, String catalog, boolean isQuoted) throws HibernateException {
16 years, 3 months
Hibernate SVN: r15197 - shards/trunk/src/java/org/hibernate/shards/strategy.
by hibernate-commits@lists.jboss.org
Author: max.ross
Date: 2008-09-14 23:59:11 -0400 (Sun, 14 Sep 2008)
New Revision: 15197
Modified:
shards/trunk/src/java/org/hibernate/shards/strategy/ShardStrategy.java
Log:
Add javadoc.
First CL from Danny!
Modified: shards/trunk/src/java/org/hibernate/shards/strategy/ShardStrategy.java
===================================================================
--- shards/trunk/src/java/org/hibernate/shards/strategy/ShardStrategy.java 2008-09-14 18:25:52 UTC (rev 15196)
+++ shards/trunk/src/java/org/hibernate/shards/strategy/ShardStrategy.java 2008-09-15 03:59:11 UTC (rev 15197)
@@ -23,6 +23,21 @@
import org.hibernate.shards.strategy.selection.ShardSelectionStrategy;
/**
+ * Interface to specify Sharding behavior.
+ *
+ * This class determines through {@link ShardAccessStrategy}, {@link ShardResolutionStrategy}, and
+ * {@link ShardSelectionStrategy} how to read, persist and update entities in the sharded collection of databases.
+ *
+ * <p>When given a query the {@link ShardAccessStrategy} will determine how the query will be distributed across
+ * the known shards - in sequence, in parallel, or some combination of the two.
+ * </p>
+ * <p> When looking for an entity with a known Id and type {@link ShardResolutionStrategy} will return all possible shards
+ * that this entity might reside on.
+ * </p>
+ * <p> When given an entity the {@link ShardSelectionStrategy} will determine which shard that object should be persisted
+ * or updated on.
+ * </p>
+ *
* @author maxr(a)google.com (Max Ross)
*/
public interface ShardStrategy {
16 years, 3 months