Example usage for org.hibernate.dialect.function SQLFunctionTemplate SQLFunctionTemplate

List of usage examples for org.hibernate.dialect.function SQLFunctionTemplate SQLFunctionTemplate

Introduction

In this page you can find the example usage for org.hibernate.dialect.function SQLFunctionTemplate SQLFunctionTemplate.

Prototype

public SQLFunctionTemplate(Type type, String template) 

Source Link

Document

Constructs a SQLFunctionTemplate

Usage

From source file:se.tillvaxtverket.tsltrust.weblogic.hibernate.SQLiteDialect.java

License:Open Source License

public SQLiteDialect() {
    super();/*from w  w w  .j  a v a2 s .  c  om*/
    registerColumnType(Types.BIT, "integer");
    registerColumnType(Types.TINYINT, "tinyint");
    registerColumnType(Types.SMALLINT, "smallint");
    registerColumnType(Types.INTEGER, "integer");
    registerColumnType(Types.BIGINT, "bigint");
    registerColumnType(Types.FLOAT, "float");
    registerColumnType(Types.REAL, "real");
    registerColumnType(Types.DOUBLE, "double");
    registerColumnType(Types.NUMERIC, "numeric");
    registerColumnType(Types.DECIMAL, "decimal");
    registerColumnType(Types.CHAR, "char");
    registerColumnType(Types.VARCHAR, "varchar");
    registerColumnType(Types.LONGVARCHAR, "longvarchar");
    registerColumnType(Types.DATE, "date");
    registerColumnType(Types.TIME, "time");
    registerColumnType(Types.TIMESTAMP, "timestamp");
    registerColumnType(Types.BINARY, "blob");
    registerColumnType(Types.VARBINARY, "blob");
    registerColumnType(Types.LONGVARBINARY, "blob");
    // registerColumnType(Types.NULL, "null");
    registerColumnType(Types.BLOB, "blob");
    registerColumnType(Types.CLOB, "clob");
    registerColumnType(Types.BOOLEAN, "integer");

    registerFunction("concat", new VarArgsSQLFunction(stringType, "", "||", ""));
    registerFunction("mod", new SQLFunctionTemplate(stringType, "?1 % ?2"));
    registerFunction("substr", new StandardSQLFunction("substr", stringType));
    registerFunction("substring", new StandardSQLFunction("substr", stringType));
}