HHH-2897 - Adding support for use of sequence objects in DB2 V8 OS390

This commit is contained in:
Lemongrass3110 2015-02-10 11:52:26 +01:00 committed by Vlad Mihalcea
parent 61ee2d2232
commit ed61fc9a8e
2 changed files with 56 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import org.hibernate.cache.spi.CacheKeysFactory;
import org.hibernate.dialect.CUBRIDDialect;
import org.hibernate.dialect.Cache71Dialect;
import org.hibernate.dialect.DB2390Dialect;
import org.hibernate.dialect.DB2390V8Dialect;
import org.hibernate.dialect.DB2400Dialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyTenFiveDialect;
@ -197,6 +198,7 @@ public class StrategySelectorBuilder {
addDialect( strategySelector, CUBRIDDialect.class );
addDialect( strategySelector, DB2Dialect.class );
addDialect( strategySelector, DB2390Dialect.class );
addDialect( strategySelector, DB2390V8Dialect.class );
addDialect( strategySelector, DB2400Dialect.class );
addDialect( strategySelector, DerbyTenFiveDialect.class );
addDialect( strategySelector, DerbyTenSixDialect.class );

View File

@ -0,0 +1,54 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2010, Red Hat Inc. 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 Inc.
*
* 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.dialect;
/**
* An SQL dialect for DB2/390 version 8.
*
* @author Tobias Sternvik
*/
public class DB2390V8Dialect extends DB2390Dialect {
@Override
public boolean supportsSequences() {
return true;
}
public String getSequenceNextValString(String sequenceName) {
return "select nextval for " + sequenceName + " from sysibm.sysdummy1";
}
public String getCreateSequenceString(String sequenceName) {
return "create sequence " + sequenceName + " as integer start with 1 increment by 1 minvalue 1 nomaxvalue nocycle nocache"; //simple default settings..
}
public String getDropSequenceString(String sequenceName) {
return "drop sequence " + sequenceName + " restrict";
}
public String getQuerySequencesString() {
return "select name from sysibm.syssequences";
}
}