Remove MckoiDialect
The last release of this database was in 8 years ago, and nobody is using it according to StackOverflow.
This commit is contained in:
parent
b1de5d6703
commit
47c001b00c
|
@ -136,16 +136,6 @@ hibernate.connection.url jdbc:hsqldb:./build/db/hsqldb/hibernate
|
||||||
#hibernate.connection.url jdbc:sybase:Tds:co3061835-a:5000/tempdb
|
#hibernate.connection.url jdbc:sybase:Tds:co3061835-a:5000/tempdb
|
||||||
|
|
||||||
|
|
||||||
## Mckoi SQL
|
|
||||||
|
|
||||||
#hibernate.dialect org.hibernate.dialect.MckoiDialect
|
|
||||||
#hibernate.connection.driver_class com.mckoi.JDBCDriver
|
|
||||||
#hibernate.connection.url jdbc:mckoi:///
|
|
||||||
#hibernate.connection.url jdbc:mckoi:local://C:/mckoi1.0.3/db.conf
|
|
||||||
#hibernate.connection.username admin
|
|
||||||
#hibernate.connection.password nimda
|
|
||||||
|
|
||||||
|
|
||||||
## SAP DB
|
## SAP DB
|
||||||
|
|
||||||
#hibernate.dialect org.hibernate.dialect.SAPDBDialect
|
#hibernate.dialect org.hibernate.dialect.SAPDBDialect
|
||||||
|
|
|
@ -119,16 +119,6 @@ hibernate.connection.url @DB_URL@
|
||||||
#hibernate.connection.url jdbc:sybase:Tds:co3061835-a:5000/tempdb
|
#hibernate.connection.url jdbc:sybase:Tds:co3061835-a:5000/tempdb
|
||||||
|
|
||||||
|
|
||||||
## Mckoi SQL
|
|
||||||
|
|
||||||
#hibernate.dialect org.hibernate.dialect.MckoiDialect
|
|
||||||
#hibernate.connection.driver_class com.mckoi.JDBCDriver
|
|
||||||
#hibernate.connection.url jdbc:mckoi:///
|
|
||||||
#hibernate.connection.url jdbc:mckoi:local://C:/mckoi1.00/db.conf
|
|
||||||
#hibernate.connection.username admin
|
|
||||||
#hibernate.connection.password nimda
|
|
||||||
|
|
||||||
|
|
||||||
## SAP DB
|
## SAP DB
|
||||||
|
|
||||||
#hibernate.dialect org.hibernate.dialect.SAPDBDialect
|
#hibernate.dialect org.hibernate.dialect.SAPDBDialect
|
||||||
|
|
|
@ -44,7 +44,6 @@ import org.hibernate.dialect.Ingres10Dialect;
|
||||||
import org.hibernate.dialect.Ingres9Dialect;
|
import org.hibernate.dialect.Ingres9Dialect;
|
||||||
import org.hibernate.dialect.IngresDialect;
|
import org.hibernate.dialect.IngresDialect;
|
||||||
import org.hibernate.dialect.InterbaseDialect;
|
import org.hibernate.dialect.InterbaseDialect;
|
||||||
import org.hibernate.dialect.MckoiDialect;
|
|
||||||
import org.hibernate.dialect.MimerSQLDialect;
|
import org.hibernate.dialect.MimerSQLDialect;
|
||||||
import org.hibernate.dialect.MySQL57Dialect;
|
import org.hibernate.dialect.MySQL57Dialect;
|
||||||
import org.hibernate.dialect.MySQL5Dialect;
|
import org.hibernate.dialect.MySQL5Dialect;
|
||||||
|
@ -210,7 +209,6 @@ public class StrategySelectorBuilder {
|
||||||
addDialect( strategySelector, Ingres9Dialect.class );
|
addDialect( strategySelector, Ingres9Dialect.class );
|
||||||
addDialect( strategySelector, Ingres10Dialect.class );
|
addDialect( strategySelector, Ingres10Dialect.class );
|
||||||
addDialect( strategySelector, InterbaseDialect.class );
|
addDialect( strategySelector, InterbaseDialect.class );
|
||||||
addDialect( strategySelector, MckoiDialect.class );
|
|
||||||
addDialect( strategySelector, MimerSQLDialect.class );
|
addDialect( strategySelector, MimerSQLDialect.class );
|
||||||
addDialect( strategySelector, MySQL5Dialect.class );
|
addDialect( strategySelector, MySQL5Dialect.class );
|
||||||
addDialect( strategySelector, MySQL57Dialect.class );
|
addDialect( strategySelector, MySQL57Dialect.class );
|
||||||
|
|
|
@ -296,21 +296,6 @@ public enum Database {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
MCKOI {
|
|
||||||
@Override
|
|
||||||
public Dialect createDialect(DialectResolutionInfo info) {
|
|
||||||
return new MckoiDialect();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean productNameMatches(String databaseName) {
|
|
||||||
return databaseName.toLowerCase().startsWith("mckoi");
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getDriverClassName(String jdbcUrl) {
|
|
||||||
return "com.mckoi.JDBCDriver";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
MIMER {
|
MIMER {
|
||||||
@Override
|
@Override
|
||||||
public Dialect createDialect(DialectResolutionInfo info) {
|
public Dialect createDialect(DialectResolutionInfo info) {
|
||||||
|
|
|
@ -1,98 +0,0 @@
|
||||||
/*
|
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
|
||||||
*
|
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
|
||||||
*/
|
|
||||||
package org.hibernate.dialect;
|
|
||||||
|
|
||||||
import org.hibernate.LockMode;
|
|
||||||
import org.hibernate.cfg.Environment;
|
|
||||||
import org.hibernate.dialect.function.CommonFunctionFactory;
|
|
||||||
import org.hibernate.dialect.lock.*;
|
|
||||||
import org.hibernate.dialect.sequence.MckoiSequenceSupport;
|
|
||||||
import org.hibernate.dialect.sequence.SequenceSupport;
|
|
||||||
import org.hibernate.persister.entity.Lockable;
|
|
||||||
import org.hibernate.query.spi.QueryEngine;
|
|
||||||
import org.hibernate.sql.CaseFragment;
|
|
||||||
import org.hibernate.sql.MckoiCaseFragment;
|
|
||||||
|
|
||||||
import java.sql.Types;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An SQL dialect compatible with McKoi SQL
|
|
||||||
*
|
|
||||||
* @author Doug Currie
|
|
||||||
* @author Gabe Hicks
|
|
||||||
*/
|
|
||||||
public class MckoiDialect extends Dialect {
|
|
||||||
/**
|
|
||||||
* Constructs a MckoiDialect
|
|
||||||
*/
|
|
||||||
public MckoiDialect() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
//Note: there is no single-precision type
|
|
||||||
//'float' and 'double' are the exact same
|
|
||||||
//double precision type.
|
|
||||||
registerColumnType( Types.FLOAT, "float" ); //precision argument not supported
|
|
||||||
registerColumnType( Types.DOUBLE, "double" ); //'double precision' not supported
|
|
||||||
|
|
||||||
//no explicit precision
|
|
||||||
registerColumnType(Types.TIMESTAMP, "timestamp");
|
|
||||||
registerColumnType(Types.TIMESTAMP_WITH_TIMEZONE, "timestamp");
|
|
||||||
|
|
||||||
getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, NO_BATCH );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initializeFunctionRegistry(QueryEngine queryEngine) {
|
|
||||||
super.initializeFunctionRegistry(queryEngine);
|
|
||||||
|
|
||||||
CommonFunctionFactory.characterLength_length( queryEngine );
|
|
||||||
CommonFunctionFactory.trim1( queryEngine );
|
|
||||||
|
|
||||||
queryEngine.getSqmFunctionRegistry().patternDescriptorBuilder( "nullif", "if(?1=?2, null, ?1)" )
|
|
||||||
.setExactArgumentCount(2)
|
|
||||||
.register();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SequenceSupport getSequenceSupport() {
|
|
||||||
return MckoiSequenceSupport.INSTANCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getForUpdateString() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public CaseFragment createCaseFragment() {
|
|
||||||
return new MckoiCaseFragment();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
|
|
||||||
// Mckoi has no known variation of a "SELECT ... FOR UPDATE" syntax...
|
|
||||||
switch (lockMode) {
|
|
||||||
case PESSIMISTIC_FORCE_INCREMENT:
|
|
||||||
return new PessimisticForceIncrementLockingStrategy(lockable, lockMode);
|
|
||||||
case PESSIMISTIC_WRITE:
|
|
||||||
return new PessimisticWriteUpdateLockingStrategy(lockable, lockMode);
|
|
||||||
case PESSIMISTIC_READ:
|
|
||||||
return new PessimisticReadUpdateLockingStrategy(lockable, lockMode);
|
|
||||||
case OPTIMISTIC:
|
|
||||||
return new OptimisticLockingStrategy(lockable, lockMode);
|
|
||||||
case OPTIMISTIC_FORCE_INCREMENT:
|
|
||||||
return new OptimisticForceIncrementLockingStrategy(lockable, lockMode);
|
|
||||||
}
|
|
||||||
if ( lockMode.greaterThan( LockMode.READ ) ) {
|
|
||||||
return new UpdateLockingStrategy( lockable, lockMode );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return new SelectLockingStrategy( lockable, lockMode );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
/*
|
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
|
||||||
*
|
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
|
||||||
*/
|
|
||||||
package org.hibernate.dialect.sequence;
|
|
||||||
|
|
||||||
import org.hibernate.MappingException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sequence support for {@link org.hibernate.dialect.MckoiDialect}.
|
|
||||||
*
|
|
||||||
* @author Gavin King
|
|
||||||
*/
|
|
||||||
public final class MckoiSequenceSupport implements SequenceSupport {
|
|
||||||
|
|
||||||
public static final SequenceSupport INSTANCE = new MckoiSequenceSupport();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSelectSequenceNextValString(String sequenceName) {
|
|
||||||
return "nextval('" + sequenceName + "')";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize) throws MappingException {
|
|
||||||
return getCreateSequenceString( sequenceName )
|
|
||||||
+ " increment " + incrementSize
|
|
||||||
+ startingValue( initialValue, incrementSize )
|
|
||||||
+ " start " + initialValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean sometimesNeedsStartingValue() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
/*
|
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
|
||||||
*
|
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
|
||||||
*/
|
|
||||||
package org.hibernate.sql;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A Mckoi IF function.
|
|
||||||
* <br>
|
|
||||||
* <code>if(..., ..., ...) as ...</code>
|
|
||||||
* <br>
|
|
||||||
* @author Gavin King
|
|
||||||
*/
|
|
||||||
public class MckoiCaseFragment extends CaseFragment {
|
|
||||||
|
|
||||||
public String toFragmentString() {
|
|
||||||
StringBuilder buf = new StringBuilder( cases.size() * 15 + 10 );
|
|
||||||
StringBuilder buf2= new StringBuilder( cases.size() );
|
|
||||||
|
|
||||||
Iterator iter = cases.entrySet().iterator();
|
|
||||||
while ( iter.hasNext() ) {
|
|
||||||
Map.Entry me = (Map.Entry) iter.next();
|
|
||||||
buf.append(" if(")
|
|
||||||
.append( me.getKey() )
|
|
||||||
.append(" is not null")
|
|
||||||
.append(", ")
|
|
||||||
.append( me.getValue() )
|
|
||||||
.append(", ");
|
|
||||||
buf2.append(")");
|
|
||||||
}
|
|
||||||
|
|
||||||
buf.append("null");
|
|
||||||
buf.append(buf2);
|
|
||||||
if (returnColumnName!=null) {
|
|
||||||
buf.append(" as ")
|
|
||||||
.append(returnColumnName);
|
|
||||||
}
|
|
||||||
|
|
||||||
return buf.toString();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue