mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-28 14:59:12 +00:00
Remove FrontBaseDialect
I can't find evidence that anyone uses this on StackOverflow, and the Dialect is not of high quality.
This commit is contained in:
parent
7267b418c5
commit
c97fb45a02
@ -35,7 +35,6 @@
|
|||||||
import org.hibernate.dialect.DerbyTenSixDialect;
|
import org.hibernate.dialect.DerbyTenSixDialect;
|
||||||
import org.hibernate.dialect.Dialect;
|
import org.hibernate.dialect.Dialect;
|
||||||
import org.hibernate.dialect.FirebirdDialect;
|
import org.hibernate.dialect.FirebirdDialect;
|
||||||
import org.hibernate.dialect.FrontBaseDialect;
|
|
||||||
import org.hibernate.dialect.H2Dialect;
|
import org.hibernate.dialect.H2Dialect;
|
||||||
import org.hibernate.dialect.HANAColumnStoreDialect;
|
import org.hibernate.dialect.HANAColumnStoreDialect;
|
||||||
import org.hibernate.dialect.HANARowStoreDialect;
|
import org.hibernate.dialect.HANARowStoreDialect;
|
||||||
@ -198,7 +197,6 @@ private void addDialects(StrategySelectorImpl strategySelector) {
|
|||||||
addDialect( strategySelector, DerbyTenSixDialect.class );
|
addDialect( strategySelector, DerbyTenSixDialect.class );
|
||||||
addDialect( strategySelector, DerbyTenSevenDialect.class );
|
addDialect( strategySelector, DerbyTenSevenDialect.class );
|
||||||
addDialect( strategySelector, FirebirdDialect.class );
|
addDialect( strategySelector, FirebirdDialect.class );
|
||||||
addDialect( strategySelector, FrontBaseDialect.class );
|
|
||||||
addDialect( strategySelector, H2Dialect.class );
|
addDialect( strategySelector, H2Dialect.class );
|
||||||
addDialect( strategySelector, HANAColumnStoreDialect.class );
|
addDialect( strategySelector, HANAColumnStoreDialect.class );
|
||||||
addDialect( strategySelector, HANARowStoreDialect.class );
|
addDialect( strategySelector, HANARowStoreDialect.class );
|
||||||
|
@ -140,21 +140,6 @@ public String getUrlPrefix() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
FRONTBASE {
|
|
||||||
@Override
|
|
||||||
public Dialect createDialect(DialectResolutionInfo info) {
|
|
||||||
return new FrontBaseDialect();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean productNameMatches(String databaseName) {
|
|
||||||
return databaseName.startsWith( "FrontBase" );
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getDriverClassName(String jdbcUrl) {
|
|
||||||
return "com.frontbase.jdbc.FBJDriver";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
H2 {
|
H2 {
|
||||||
@Override
|
@Override
|
||||||
public Dialect createDialect(DialectResolutionInfo info) {
|
public Dialect createDialect(DialectResolutionInfo info) {
|
||||||
|
@ -1,109 +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.dialect.lock.*;
|
|
||||||
import org.hibernate.persister.entity.Lockable;
|
|
||||||
|
|
||||||
import java.sql.Types;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An SQL Dialect for Frontbase. Assumes you're using the latest version
|
|
||||||
* of the FrontBase JDBC driver, available from <tt>http://frontbase.com/</tt>
|
|
||||||
* <p>
|
|
||||||
* <b>NOTE</b>: The latest JDBC driver is not always included with the
|
|
||||||
* latest release of FrontBase. Download the driver separately, and enjoy
|
|
||||||
* the informative release notes.
|
|
||||||
* <p>
|
|
||||||
* This dialect was tested with JDBC driver version 2.3.1. This driver
|
|
||||||
* contains a bug that causes batches of updates to fail. (The bug should be
|
|
||||||
* fixed in the next release of the JDBC driver.) If you are using JDBC driver
|
|
||||||
* 2.3.1, you can work-around this problem by setting the following in your
|
|
||||||
* <tt>hibernate.properties</tt> file: <tt>hibernate.jdbc.batch_size=15</tt>
|
|
||||||
*
|
|
||||||
* @author Ron Lussier <tt>rlussier@lenscraft.com</tt>
|
|
||||||
*/
|
|
||||||
public class FrontBaseDialect extends Dialect {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a FrontBaseDialect
|
|
||||||
*/
|
|
||||||
public FrontBaseDialect() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
registerColumnType( Types.BOOLEAN, "bit" );
|
|
||||||
registerColumnType( Types.BIGINT, "longint" );
|
|
||||||
|
|
||||||
//FrontBase has no 'binary' nor 'varbinary'
|
|
||||||
registerColumnType( Types.BINARY, "bit($l)");
|
|
||||||
registerColumnType( Types.VARBINARY, "bit varying($l)");
|
|
||||||
|
|
||||||
//no precision
|
|
||||||
registerColumnType( Types.TIMESTAMP, "timestamp" );
|
|
||||||
registerColumnType( Types.TIMESTAMP_WITH_TIMEZONE, "timestamp with time zone" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getPreferredSqlTypeCodeForBoolean() {
|
|
||||||
return Types.BIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getCascadeConstraintsString() {
|
|
||||||
return " cascade";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean dropConstraints() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* FrontBase doesn't support this syntax, which was dropped with SQL92.
|
|
||||||
* <p/>
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String getForUpdateString() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getCurrentTimestampSelectString() {
|
|
||||||
// TODO : not sure this is correct, could not find docs on how to do this.
|
|
||||||
return "{?= call current_timestamp}";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isCurrentTimestampSelectStringCallable() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
|
|
||||||
// Frontbase 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 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user