rename things to 'Emulation' for consistency

This commit is contained in:
gavin 2021-06-03 16:03:19 +02:00 committed by Christian Beikov
parent f9534ead03
commit 97869203ba
8 changed files with 23 additions and 24 deletions

View File

@ -12,7 +12,7 @@ import org.hibernate.query.NullOrdering;
import org.hibernate.boot.TempTableDdlTransactionHandling; import org.hibernate.boot.TempTableDdlTransactionHandling;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.dialect.function.CommonFunctionFactory; import org.hibernate.dialect.function.CommonFunctionFactory;
import org.hibernate.dialect.function.IndividualLeastGreatestEmulation; import org.hibernate.dialect.function.CaseLeastGreatestEmulation;
import org.hibernate.dialect.identity.AbstractTransactSQLIdentityColumnSupport; import org.hibernate.dialect.identity.AbstractTransactSQLIdentityColumnSupport;
import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.identity.IdentityColumnSupport;
import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.mapping.EntityMappingType;
@ -113,8 +113,8 @@ abstract class AbstractTransactSQLDialect extends Dialect {
CommonFunctionFactory.datepartDatename( queryEngine ); CommonFunctionFactory.datepartDatename( queryEngine );
CommonFunctionFactory.lastDay_eomonth( queryEngine ); CommonFunctionFactory.lastDay_eomonth( queryEngine );
queryEngine.getSqmFunctionRegistry().register( "least", new IndividualLeastGreatestEmulation( true ) ); queryEngine.getSqmFunctionRegistry().register( "least", new CaseLeastGreatestEmulation( true ) );
queryEngine.getSqmFunctionRegistry().register( "greatest", new IndividualLeastGreatestEmulation( false ) ); queryEngine.getSqmFunctionRegistry().register( "greatest", new CaseLeastGreatestEmulation( false ) );
} }
@Override @Override

View File

@ -11,9 +11,9 @@ import org.hibernate.NotYetImplementedFor6Exception;
import org.hibernate.boot.TempTableDdlTransactionHandling; import org.hibernate.boot.TempTableDdlTransactionHandling;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.dialect.function.CommonFunctionFactory; import org.hibernate.dialect.function.CommonFunctionFactory;
import org.hibernate.dialect.function.DerbyLpadFunction; import org.hibernate.dialect.function.DerbyLpadEmulation;
import org.hibernate.dialect.function.DerbyRpadFunction; import org.hibernate.dialect.function.DerbyRpadEmulation;
import org.hibernate.dialect.function.IndividualLeastGreatestEmulation; import org.hibernate.dialect.function.CaseLeastGreatestEmulation;
import org.hibernate.dialect.function.InsertSubstringOverlayEmulation; import org.hibernate.dialect.function.InsertSubstringOverlayEmulation;
import org.hibernate.dialect.identity.DB2IdentityColumnSupport; import org.hibernate.dialect.identity.DB2IdentityColumnSupport;
import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.identity.IdentityColumnSupport;
@ -207,10 +207,10 @@ public class DerbyDialect extends Dialect {
.register(); .register();
//no way I can see to pad with anything other than spaces //no way I can see to pad with anything other than spaces
queryEngine.getSqmFunctionRegistry().register( "lpad", new DerbyLpadFunction() ); queryEngine.getSqmFunctionRegistry().register( "lpad", new DerbyLpadEmulation() );
queryEngine.getSqmFunctionRegistry().register( "rpad", new DerbyRpadFunction() ); queryEngine.getSqmFunctionRegistry().register( "rpad", new DerbyRpadEmulation() );
queryEngine.getSqmFunctionRegistry().register( "least", new IndividualLeastGreatestEmulation( true ) ); queryEngine.getSqmFunctionRegistry().register( "least", new CaseLeastGreatestEmulation( true ) );
queryEngine.getSqmFunctionRegistry().register( "greatest", new IndividualLeastGreatestEmulation( false ) ); queryEngine.getSqmFunctionRegistry().register( "greatest", new CaseLeastGreatestEmulation( false ) );
queryEngine.getSqmFunctionRegistry().register( "overlay", new InsertSubstringOverlayEmulation( true ) ); queryEngine.getSqmFunctionRegistry().register( "overlay", new InsertSubstringOverlayEmulation( true ) );
} }

View File

@ -8,8 +8,7 @@ package org.hibernate.dialect;
import org.hibernate.boot.TempTableDdlTransactionHandling; import org.hibernate.boot.TempTableDdlTransactionHandling;
import org.hibernate.dialect.function.CommonFunctionFactory; import org.hibernate.dialect.function.CommonFunctionFactory;
import org.hibernate.dialect.function.CurrentFunction; import org.hibernate.dialect.function.CaseLeastGreatestEmulation;
import org.hibernate.dialect.function.IndividualLeastGreatestEmulation;
import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.identity.IdentityColumnSupport;
import org.hibernate.dialect.identity.InformixIdentityColumnSupport; import org.hibernate.dialect.identity.InformixIdentityColumnSupport;
import org.hibernate.dialect.pagination.FirstLimitHandler; import org.hibernate.dialect.pagination.FirstLimitHandler;
@ -162,8 +161,8 @@ public class InformixDialect extends Dialect {
//coalesce() and nullif() both supported since Informix 12 //coalesce() and nullif() both supported since Informix 12
queryEngine.getSqmFunctionRegistry().register( "least", new IndividualLeastGreatestEmulation( true ) ); queryEngine.getSqmFunctionRegistry().register( "least", new CaseLeastGreatestEmulation( true ) );
queryEngine.getSqmFunctionRegistry().register( "greatest", new IndividualLeastGreatestEmulation( false ) ); queryEngine.getSqmFunctionRegistry().register( "greatest", new CaseLeastGreatestEmulation( false ) );
} }
@Override @Override

View File

@ -8,7 +8,7 @@ package org.hibernate.dialect;
import org.hibernate.*; import org.hibernate.*;
import org.hibernate.dialect.function.CommonFunctionFactory; import org.hibernate.dialect.function.CommonFunctionFactory;
import org.hibernate.dialect.function.SQLServerFormatFunction; import org.hibernate.dialect.function.SQLServerFormatEmulation;
import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.identity.IdentityColumnSupport;
import org.hibernate.dialect.identity.SQLServerIdentityColumnSupport; import org.hibernate.dialect.identity.SQLServerIdentityColumnSupport;
import org.hibernate.dialect.pagination.LimitHandler; import org.hibernate.dialect.pagination.LimitHandler;
@ -149,7 +149,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
} }
if ( getVersion() >= 11 ) { if ( getVersion() >= 11 ) {
queryEngine.getSqmFunctionRegistry().register( "format", new SQLServerFormatFunction( this ) ); queryEngine.getSqmFunctionRegistry().register( "format", new SQLServerFormatEmulation( this ) );
//actually translate() was added in 2017 but //actually translate() was added in 2017 but
//it's not worth adding a new dialect for that! //it's not worth adding a new dialect for that!

View File

@ -19,12 +19,12 @@ import org.hibernate.sql.ast.tree.SqlAstNode;
* *
* @author Christian Beikov * @author Christian Beikov
*/ */
public class IndividualLeastGreatestEmulation public class CaseLeastGreatestEmulation
extends AbstractSqmSelfRenderingFunctionDescriptor { extends AbstractSqmSelfRenderingFunctionDescriptor {
private final String operator; private final String operator;
public IndividualLeastGreatestEmulation(boolean least) { public CaseLeastGreatestEmulation(boolean least) {
super( super(
least ? "least" : "greatest", least ? "least" : "greatest",
StandardArgumentsValidators.min( 2 ), StandardArgumentsValidators.min( 2 ),

View File

@ -22,10 +22,10 @@ import org.hibernate.type.StandardBasicTypes;
* *
* @author Christian Beikov * @author Christian Beikov
*/ */
public class DerbyLpadFunction public class DerbyLpadEmulation
extends AbstractSqmSelfRenderingFunctionDescriptor { extends AbstractSqmSelfRenderingFunctionDescriptor {
public DerbyLpadFunction() { public DerbyLpadEmulation() {
super( super(
"lpad", "lpad",
StandardArgumentsValidators.exactly( 2 ), StandardArgumentsValidators.exactly( 2 ),

View File

@ -22,10 +22,10 @@ import org.hibernate.type.StandardBasicTypes;
* *
* @author Christian Beikov * @author Christian Beikov
*/ */
public class DerbyRpadFunction public class DerbyRpadEmulation
extends AbstractSqmSelfRenderingFunctionDescriptor { extends AbstractSqmSelfRenderingFunctionDescriptor {
public DerbyRpadFunction() { public DerbyRpadEmulation() {
super( super(
"rpad", "rpad",
StandardArgumentsValidators.exactly( 2 ), StandardArgumentsValidators.exactly( 2 ),

View File

@ -26,11 +26,11 @@ import org.hibernate.type.spi.TypeConfiguration;
* *
* @author Christian Beikov * @author Christian Beikov
*/ */
public class SQLServerFormatFunction extends AbstractSqmSelfRenderingFunctionDescriptor { public class SQLServerFormatEmulation extends AbstractSqmSelfRenderingFunctionDescriptor {
private final SQLServerDialect dialect; private final SQLServerDialect dialect;
public SQLServerFormatFunction(SQLServerDialect dialect) { public SQLServerFormatEmulation(SQLServerDialect dialect) {
super( super(
"format", "format",
StandardArgumentsValidators.exactly( 2 ), StandardArgumentsValidators.exactly( 2 ),