Search in sources :

Example 21 with CommonFunctionFactory

use of org.hibernate.dialect.function.CommonFunctionFactory in project hibernate-orm by hibernate.

the class CUBRIDDialect method initializeFunctionRegistry.

@Override
public void initializeFunctionRegistry(QueryEngine queryEngine) {
    super.initializeFunctionRegistry(queryEngine);
    CommonFunctionFactory functionFactory = new CommonFunctionFactory(queryEngine);
    functionFactory.trim2();
    functionFactory.space();
    functionFactory.reverse();
    functionFactory.repeat();
    functionFactory.crc32();
    functionFactory.cot();
    functionFactory.log2();
    functionFactory.log10();
    functionFactory.pi();
    // rand() returns an integer between 0 and 231 on CUBRID
    // functionFactory.rand();
    functionFactory.radians();
    functionFactory.degrees();
    functionFactory.systimestamp();
    // TODO: CUBRID also has systime()/sysdate() returning TIME/DATE
    functionFactory.localtimeLocaltimestamp();
    functionFactory.hourMinuteSecond();
    functionFactory.yearMonthDay();
    functionFactory.dayofweekmonthyear();
    functionFactory.lastDay();
    functionFactory.weekQuarter();
    functionFactory.octetLength();
    functionFactory.bitLength();
    functionFactory.md5();
    functionFactory.trunc();
    functionFactory.truncate();
    functionFactory.toCharNumberDateTimestamp();
    functionFactory.substr();
    // also natively supports ANSI-style substring()
    functionFactory.instr();
    functionFactory.translate();
    functionFactory.ceiling_ceil();
    functionFactory.sha1();
    functionFactory.sha2();
    functionFactory.ascii();
    functionFactory.char_chr();
    functionFactory.position();
    // functionFactory.concat_pipeOperator();
    functionFactory.insert();
    functionFactory.nowCurdateCurtime();
    functionFactory.makedateMaketime();
    functionFactory.bitandorxornot_bitAndOrXorNot();
    functionFactory.median();
    functionFactory.stddev();
    functionFactory.stddevPopSamp();
    functionFactory.variance();
    functionFactory.varPopSamp();
    functionFactory.datediff();
    functionFactory.adddateSubdateAddtimeSubtime();
    functionFactory.addMonths();
    functionFactory.monthsBetween();
    functionFactory.rownumInstOrderbyGroupbyNum();
}
Also used : CommonFunctionFactory(org.hibernate.dialect.function.CommonFunctionFactory)

Example 22 with CommonFunctionFactory

use of org.hibernate.dialect.function.CommonFunctionFactory in project hibernate-orm by hibernate.

the class MimerSQLDialect method initializeFunctionRegistry.

@Override
public void initializeFunctionRegistry(QueryEngine queryEngine) {
    super.initializeFunctionRegistry(queryEngine);
    CommonFunctionFactory functionFactory = new CommonFunctionFactory(queryEngine);
    functionFactory.soundex();
    functionFactory.octetLength();
    functionFactory.bitLength();
    functionFactory.truncate();
    functionFactory.repeat();
    functionFactory.pad_repeat();
    functionFactory.dayofweekmonthyear();
    functionFactory.concat_pipeOperator();
    functionFactory.position();
    functionFactory.localtimeLocaltimestamp();
}
Also used : CommonFunctionFactory(org.hibernate.dialect.function.CommonFunctionFactory)

Example 23 with CommonFunctionFactory

use of org.hibernate.dialect.function.CommonFunctionFactory in project hibernate-orm by hibernate.

the class RDMSOS2200Dialect method initializeFunctionRegistry.

@Override
public void initializeFunctionRegistry(QueryEngine queryEngine) {
    super.initializeFunctionRegistry(queryEngine);
    CommonFunctionFactory functionFactory = new CommonFunctionFactory(queryEngine);
    functionFactory.cosh();
    functionFactory.sinh();
    functionFactory.tanh();
    functionFactory.cot();
    functionFactory.log();
    functionFactory.log10();
    functionFactory.pi();
    functionFactory.rand();
    functionFactory.trunc();
    functionFactory.truncate();
    functionFactory.soundex();
    functionFactory.trim2();
    functionFactory.space();
    functionFactory.repeat();
    // functionFactory.replicate(); //synonym for more common repeat()
    functionFactory.initcap();
    functionFactory.instr();
    functionFactory.substr();
    functionFactory.translate();
    functionFactory.yearMonthDay();
    functionFactory.hourMinuteSecond();
    functionFactory.dayofweekmonthyear();
    functionFactory.weekQuarter();
    functionFactory.daynameMonthname();
    functionFactory.lastDay();
    functionFactory.ceiling_ceil();
    functionFactory.concat_pipeOperator();
    functionFactory.ascii();
    functionFactory.chr_char();
    functionFactory.insert();
    functionFactory.addMonths();
    functionFactory.monthsBetween();
}
Also used : CommonFunctionFactory(org.hibernate.dialect.function.CommonFunctionFactory)

Example 24 with CommonFunctionFactory

use of org.hibernate.dialect.function.CommonFunctionFactory in project hibernate-orm by hibernate.

the class TeradataDialect method initializeFunctionRegistry.

@Override
public void initializeFunctionRegistry(QueryEngine queryEngine) {
    super.initializeFunctionRegistry(queryEngine);
    final BasicTypeRegistry basicTypeRegistry = queryEngine.getTypeConfiguration().getBasicTypeRegistry();
    final BasicType<String> stringType = basicTypeRegistry.resolve(StandardBasicTypes.STRING);
    CommonFunctionFactory functionFactory = new CommonFunctionFactory(queryEngine);
    functionFactory.concat_pipeOperator();
    functionFactory.octetLength();
    functionFactory.moreHyperbolic();
    functionFactory.instr();
    functionFactory.substr();
    functionFactory.substring_substr();
    // also natively supports ANSI-style substring()
    functionFactory.position();
    functionFactory.bitLength_pattern("octet_length(cast(?1 as char))*4");
    queryEngine.getSqmFunctionRegistry().patternDescriptorBuilder("mod", "(?1 mod ?2)").setInvariantType(stringType).setExactArgumentCount(2).register();
    if (getVersion().isSameOrAfter(14)) {
        // list actually taken from Teradata 15 docs
        functionFactory.lastDay();
        functionFactory.initcap();
        functionFactory.trim2();
        functionFactory.soundex();
        functionFactory.ascii();
        functionFactory.char_chr();
        functionFactory.trunc();
        functionFactory.moreHyperbolic();
        functionFactory.monthsBetween();
        functionFactory.addMonths();
        functionFactory.stddevPopSamp();
        functionFactory.varPopSamp();
    }
    // No idea since when this is supported
    functionFactory.windowFunctions();
    functionFactory.inverseDistributionOrderedSetAggregates();
    functionFactory.hypotheticalOrderedSetAggregates();
}
Also used : CommonFunctionFactory(org.hibernate.dialect.function.CommonFunctionFactory) BasicTypeRegistry(org.hibernate.type.BasicTypeRegistry)

Example 25 with CommonFunctionFactory

use of org.hibernate.dialect.function.CommonFunctionFactory in project hibernate-orm by hibernate.

the class TimesTenDialect method initializeFunctionRegistry.

@Override
public void initializeFunctionRegistry(QueryEngine queryEngine) {
    super.initializeFunctionRegistry(queryEngine);
    CommonFunctionFactory functionFactory = new CommonFunctionFactory(queryEngine);
    functionFactory.trim2();
    functionFactory.soundex();
    functionFactory.trunc();
    functionFactory.toCharNumberDateTimestamp();
    functionFactory.ceiling_ceil();
    functionFactory.instr();
    functionFactory.substr();
    functionFactory.substring_substr();
    functionFactory.leftRight_substr();
    functionFactory.char_chr();
    functionFactory.rownumRowid();
    functionFactory.sysdate();
    functionFactory.addMonths();
    functionFactory.monthsBetween();
    queryEngine.getSqmFunctionRegistry().registerBinaryTernaryPattern("locate", queryEngine.getTypeConfiguration().getBasicTypeRegistry().resolve(StandardBasicTypes.INTEGER), "instr(?2,?1)", "instr(?2,?1,?3)", STRING, STRING, INTEGER, queryEngine.getTypeConfiguration()).setArgumentListSignature("(pattern, string[, start])");
}
Also used : CommonFunctionFactory(org.hibernate.dialect.function.CommonFunctionFactory)

Aggregations

CommonFunctionFactory (org.hibernate.dialect.function.CommonFunctionFactory)30 BasicTypeRegistry (org.hibernate.type.BasicTypeRegistry)9 CountFunction (org.hibernate.dialect.function.CountFunction)4 Date (java.util.Date)3 CaseLeastGreatestEmulation (org.hibernate.dialect.function.CaseLeastGreatestEmulation)3 CastingConcatFunction (org.hibernate.dialect.function.CastingConcatFunction)3 TypeConfiguration (org.hibernate.type.spi.TypeConfiguration)3 InsertSubstringOverlayEmulation (org.hibernate.dialect.function.InsertSubstringOverlayEmulation)2 IntegralTimestampaddFunction (org.hibernate.dialect.function.IntegralTimestampaddFunction)2 DateTimeUtils.appendAsDate (org.hibernate.type.descriptor.DateTimeUtils.appendAsDate)2 Instant (java.time.Instant)1 LocalDate (java.time.LocalDate)1 LocalDateTime (java.time.LocalDateTime)1 LocalTime (java.time.LocalTime)1 OffsetDateTime (java.time.OffsetDateTime)1 CastFunction (org.hibernate.dialect.function.CastFunction)1 CastStrEmulation (org.hibernate.dialect.function.CastStrEmulation)1 CoalesceIfnullEmulation (org.hibernate.dialect.function.CoalesceIfnullEmulation)1 CurrentFunction (org.hibernate.dialect.function.CurrentFunction)1 DB2FormatEmulation (org.hibernate.dialect.function.DB2FormatEmulation)1