Example usage for org.hibernate.type StandardBasicTypes NUMERIC_BOOLEAN

List of usage examples for org.hibernate.type StandardBasicTypes NUMERIC_BOOLEAN

Introduction

In this page you can find the example usage for org.hibernate.type StandardBasicTypes NUMERIC_BOOLEAN.

Prototype

NumericBooleanType NUMERIC_BOOLEAN

To view the source code for org.hibernate.type StandardBasicTypes NUMERIC_BOOLEAN.

Click Source Link

Document

The standard Hibernate type for mapping Boolean to JDBC java.sql.Types#INTEGER INTEGER .

Usage

From source file:com.vmware.sqlfire.hibernate.SQLFireDialect.java

License:Open Source License

public SQLFireDialect() {
    super();// ww  w  .  jav  a 2 s. c  o m
    LOG.info("SQLFireDialect for Hibernate 4 initialized.");

    registerFunction("concat", new DerbyConcatFunction());
    registerFunction("trim", new AnsiTrimFunction());
    registerFunction("value", new StandardSQLFunction("coalesce"));
    registerFunction("nvl", new NvlFunction());
    registerFunction("groups", new StandardSQLFunction("GROUPS", StandardBasicTypes.STRING));
    registerFunction("dsid", new StandardSQLFunction("DSID", StandardBasicTypes.STRING));
    registerFunction("groupsintersection",
            new StandardSQLFunction("GROUPSINTERSECTION", StandardBasicTypes.STRING));
    registerFunction("groupsintersect", new StandardSQLFunction("GROUPSINTERSECT", StandardBasicTypes.BOOLEAN));
    registerFunction("groupsunion", new StandardSQLFunction("GROUPSUNION", StandardBasicTypes.STRING));
    registerFunction("longint", new StandardSQLFunction("bigint", StandardBasicTypes.LONG));
    registerFunction("int", new StandardSQLFunction("integer", StandardBasicTypes.INTEGER));
    registerFunction("pi", new StandardSQLFunction("pi", StandardBasicTypes.DOUBLE));
    registerFunction("random", new NoArgSQLFunction("random", StandardBasicTypes.DOUBLE));
    registerFunction("rand", new StandardSQLFunction("rand", StandardBasicTypes.DOUBLE));// override
    registerFunction("sinh", new StandardSQLFunction("sinh", StandardBasicTypes.DOUBLE));
    registerFunction("cosh", new StandardSQLFunction("cosh", StandardBasicTypes.DOUBLE));
    registerFunction("tanh", new StandardSQLFunction("tanh", StandardBasicTypes.DOUBLE));
    registerFunction("user", new NoArgSQLFunction("USER", StandardBasicTypes.STRING, false));
    registerFunction("current_user", new NoArgSQLFunction("CURRENT_USER", StandardBasicTypes.STRING, false));
    registerFunction("session_user", new NoArgSQLFunction("SESSION_USER", StandardBasicTypes.STRING, false));
    registerFunction("current isolation",
            new NoArgSQLFunction("CURRENT ISOLATION", StandardBasicTypes.STRING, false));
    registerFunction("current_role", new NoArgSQLFunction("CURRENT_ROLE", StandardBasicTypes.STRING, false));
    registerFunction("current schema",
            new NoArgSQLFunction("CURRENT SCHEMA", StandardBasicTypes.STRING, false));
    registerFunction("current sqlid", new NoArgSQLFunction("CURRENT SQLID", StandardBasicTypes.STRING, false));
    registerFunction("xmlexists", new StandardSQLFunction("XMLEXISTS", StandardBasicTypes.NUMERIC_BOOLEAN));
    registerFunction("xmlparse", new StandardSQLFunction("XMLPARSE", StandardBasicTypes.TEXT));
    registerFunction("xmlquery", new StandardSQLFunction("XMLQUERY", StandardBasicTypes.STRING));
    registerFunction("xmlserialize", new StandardSQLFunction("XMLSERIALIZE", StandardBasicTypes.STRING));
    registerFunction("get_current_connection",
            new NoArgSQLFunction("GET_CURRENT_CONNECTION", StandardBasicTypes.BINARY, true));
    registerFunction("identity_val_local",
            new NoArgSQLFunction("IDENTITY_VAL_LOCAL", StandardBasicTypes.BINARY, true));
}

From source file:com.vmware.sqlfire.hibernate.v4.v0.SQLFireDialect.java

License:Open Source License

public SQLFireDialect() {
    super();//  w w w  .j av  a 2 s.c o m
    LOG.info("SQLFireDialect for Hibernate 4.0 initialized.");

    registerFunction("concat", new DerbyConcatFunction());
    registerFunction("trim", new AnsiTrimFunction());
    registerFunction("value", new StandardSQLFunction("coalesce"));
    registerFunction("nvl", new NvlFunction());
    registerFunction("groups", new StandardSQLFunction("GROUPS", StandardBasicTypes.STRING));
    registerFunction("dsid", new StandardSQLFunction("DSID", StandardBasicTypes.STRING));
    registerFunction("groupsintersection",
            new StandardSQLFunction("GROUPSINTERSECTION", StandardBasicTypes.STRING));
    registerFunction("groupsintersect", new StandardSQLFunction("GROUPSINTERSECT", StandardBasicTypes.BOOLEAN));
    registerFunction("groupsunion", new StandardSQLFunction("GROUPSUNION", StandardBasicTypes.STRING));
    registerFunction("longint", new StandardSQLFunction("bigint", StandardBasicTypes.LONG));
    registerFunction("int", new StandardSQLFunction("integer", StandardBasicTypes.INTEGER));
    registerFunction("pi", new StandardSQLFunction("pi", StandardBasicTypes.DOUBLE));
    registerFunction("random", new NoArgSQLFunction("random", StandardBasicTypes.DOUBLE));
    registerFunction("rand", new StandardSQLFunction("rand", StandardBasicTypes.DOUBLE));// override
    registerFunction("sinh", new StandardSQLFunction("sinh", StandardBasicTypes.DOUBLE));
    registerFunction("cosh", new StandardSQLFunction("cosh", StandardBasicTypes.DOUBLE));
    registerFunction("tanh", new StandardSQLFunction("tanh", StandardBasicTypes.DOUBLE));
    registerFunction("user", new NoArgSQLFunction("USER", StandardBasicTypes.STRING, false));
    registerFunction("current_user", new NoArgSQLFunction("CURRENT_USER", StandardBasicTypes.STRING, false));
    registerFunction("session_user", new NoArgSQLFunction("SESSION_USER", StandardBasicTypes.STRING, false));
    registerFunction("current isolation",
            new NoArgSQLFunction("CURRENT ISOLATION", StandardBasicTypes.STRING, false));
    registerFunction("current_role", new NoArgSQLFunction("CURRENT_ROLE", StandardBasicTypes.STRING, false));
    registerFunction("current schema",
            new NoArgSQLFunction("CURRENT SCHEMA", StandardBasicTypes.STRING, false));
    registerFunction("current sqlid", new NoArgSQLFunction("CURRENT SQLID", StandardBasicTypes.STRING, false));
    registerFunction("xmlexists", new StandardSQLFunction("XMLEXISTS", StandardBasicTypes.NUMERIC_BOOLEAN));
    registerFunction("xmlparse", new StandardSQLFunction("XMLPARSE", StandardBasicTypes.TEXT));
    registerFunction("xmlquery", new StandardSQLFunction("XMLQUERY", StandardBasicTypes.STRING));
    registerFunction("xmlserialize", new StandardSQLFunction("XMLSERIALIZE", StandardBasicTypes.STRING));
    registerFunction("get_current_connection",
            new NoArgSQLFunction("GET_CURRENT_CONNECTION", StandardBasicTypes.BINARY, true));
    registerFunction("identity_val_local",
            new NoArgSQLFunction("IDENTITY_VAL_LOCAL", StandardBasicTypes.BINARY, true));
}