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() {