Example usage for org.hibernate.type StandardBasicTypes FLOAT

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

Introduction

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

Prototype

FloatType FLOAT

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

Click Source Link

Document

The standard Hibernate type for mapping Float to JDBC java.sql.Types#FLOAT FLOAT .

Usage

From source file:com.agroservices.hibernate.Dialect.java

public Dialect() {
    super();//  www  .j  a  v  a2 s .c  om
    registerFunction("date_add_interval",
            new SQLFunctionTemplate(StandardBasicTypes.DATE, "DATE_ADD(?1, INTERVAL ?2 ?3)"));
    registerFunction("date_diff", new SQLFunctionTemplate(StandardBasicTypes.INTEGER, "DATEDIFF(?1, ?2)"));
    registerFunction("cast_new", new SQLFunctionTemplate(StandardBasicTypes.FLOAT, "CAST(?1 as DECIMAL)"));
}

From source file:com.liferay.portal.dao.orm.hibernate.FloatType.java

License:Open Source License

public Type[] getPropertyTypes() {
    return new Type[] { StandardBasicTypes.FLOAT };
}

From source file:com.liferay.portal.dao.orm.hibernate.FloatType.java

License:Open Source License

public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner)
        throws SQLException {

    Float value = StandardBasicTypes.FLOAT.nullSafeGet(rs, names[0], session);

    if (value == null) {
        return DEFAULT_VALUE;
    } else {//from  ww w .j  a v a2  s. co m
        return value;
    }
}

From source file:daoImpl.GroupsDAOImpl.java

@Override
public List<SearchResult> findNearestGroups(float lati, float longi, float maxDistance) {
    Session session = sFac.openSession();
    SQLQuery getDistances = session.createSQLQuery("Select groups.group_id, "
            + "(6371 * acos( cos( radians(:lati )) * cos( radians( groups.latitude ) ) * cos( radians( groups.longitude ) - radians(:longi) ) + sin( radians(:lati) ) * sin( radians( groups.latitude ) ) ) ) as distance "
            + "from groups having distance < :maxDistance order by distance;");
    getDistances.setParameter("lati", lati);
    getDistances.setParameter("longi", longi);
    getDistances.setParameter("maxDistance", maxDistance);
    getDistances.addScalar("group_id", StandardBasicTypes.INTEGER);
    getDistances.addScalar("distance", StandardBasicTypes.FLOAT);

    List<Object[]> closestGroups = getDistances.list();

    if (closestGroups.isEmpty())
        return new ArrayList<>();

    ArrayList groupsToGet = new ArrayList<>();

    for (Object[] r : closestGroups) {
        int i = (int) r[0];
        groupsToGet.add(i);//from w w w  .  j a v  a 2 s .c om
    }

    Query getGroups = session.createQuery(
            "from Groups G left join fetch G.tagses left join fetch G.usersGroupses where G.groupId in (:ids)");
    getGroups.setParameterList("ids", groupsToGet);
    getGroups.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
    List<Groups> groupsFound = getGroups.list();

    ArrayList<SearchResult> results = new ArrayList<>();

    for (int i = 0; i < groupsFound.size(); i++) {
        SearchResult s = new SearchResult(groupsFound.get(i), (float) (closestGroups.get(i)[1]));
        results.add(s);
    }
    session.close();
    return results;
}

From source file:daoImpl.GroupsDAOImpl.java

@Override
public List<SearchResult> findNearestGroupsByName(float lati, float longi, float maxDistance,
        String searchTerm) {/*from   ww  w.  ja  v  a 2s. c om*/
    Session session = sFac.openSession();
    SQLQuery getDistances = session.createSQLQuery("Select groups.group_id, "
            + "(6371 * acos( cos( radians(:lati )) * cos( radians( groups.latitude ) ) * cos( radians( groups.longitude ) - radians(:longi) ) + sin( radians(:lati) ) * sin( radians( groups.latitude ) ) ) ) as distance "
            + "from groups where groups.groupname like concat('%', :name , '%') having distance < :maxDistance order by distance;");
    getDistances.setParameter("lati", lati);
    getDistances.setParameter("longi", longi);
    getDistances.setParameter("maxDistance", maxDistance);
    getDistances.setParameter("name", searchTerm);
    getDistances.addScalar("group_id", StandardBasicTypes.INTEGER);
    getDistances.addScalar("distance", StandardBasicTypes.FLOAT);
    List<Object[]> closestGroups = getDistances.list();

    if (closestGroups.isEmpty())
        return new ArrayList<>();

    ArrayList groupsToGet = new ArrayList<>();

    for (Object[] r : closestGroups) {
        int i = (int) r[0];
        groupsToGet.add(i);
    }

    Query getGroups = session.createQuery(
            "from Groups G left join fetch G.tagses left join fetch G.usersGroupses where G.groupId in (:ids)");
    getGroups.setParameterList("ids", groupsToGet);
    getGroups.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
    List<Groups> groupsFound = getGroups.list();

    ArrayList<SearchResult> results = new ArrayList<>();

    for (int i = 0; i < groupsFound.size(); i++) {
        SearchResult s = new SearchResult(groupsFound.get(i), (float) (closestGroups.get(i)[1]));
        results.add(s);
    }
    session.close();
    return results;
}

From source file:daoImpl.GroupsDAOImpl.java

@Override
public List<SearchResult> findNearestGroupsByDesc(float lati, float longi, float maxDistance,
        String description) {//from w  ww.  j  a va 2s  .  c o  m
    Session session = sFac.openSession();
    SQLQuery getDistances = session.createSQLQuery("Select groups.group_id, "
            + "(6371 * acos( cos( radians(:lati )) * cos( radians( groups.latitude ) ) * cos( radians( groups.longitude ) - radians(:longi) ) + sin( radians(:lati) ) * sin( radians( groups.latitude ) ) ) ) as distance "
            + "from groups where groups.description like concat('%', :name , '%') having distance < :maxDistance order by distance;");
    getDistances.setParameter("lati", lati);
    getDistances.setParameter("longi", longi);
    getDistances.setParameter("maxDistance", maxDistance);
    getDistances.setParameter("name", description);
    getDistances.addScalar("group_id", StandardBasicTypes.INTEGER);
    getDistances.addScalar("distance", StandardBasicTypes.FLOAT);
    List<Object[]> closestGroups = getDistances.list();

    if (closestGroups.isEmpty())
        return new ArrayList<>();

    ArrayList groupsToGet = new ArrayList<>();

    for (Object[] r : closestGroups) {
        int i = (int) r[0];
        groupsToGet.add(i);
    }

    Query getGroups = session.createQuery(
            "from Groups G left join fetch G.tagses left join fetch G.usersGroupses where G.groupId in (:ids)");
    getGroups.setParameterList("ids", groupsToGet);
    getGroups.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
    List<Groups> groupsFound = getGroups.list();

    ArrayList<SearchResult> results = new ArrayList<>();

    for (int i = 0; i < groupsFound.size(); i++) {
        SearchResult s = new SearchResult(groupsFound.get(i), (float) (closestGroups.get(i)[1]));
        results.add(s);
    }
    session.close();
    return results;
}

From source file:daoImpl.GroupsDAOImpl.java

@Override
public List<SearchResult> findNearestGroupsByTag(float latitude, float longitude, float maxDistance,
        String tag) {//from w w  w .j a  va  2 s  . co  m
    Session session = sFac.openSession();
    SQLQuery query = session.createSQLQuery(
            "Select groups.group_id, (6371 * acos( cos( radians(:lati )) * cos( radians( groups.latitude ) ) * cos( radians( groups.longitude ) - radians(:longi) ) + sin( radians(:lati) ) * sin( radians( groups.latitude ) ) ) ) as distance from groups join groups_tags on (groups.group_id=groups_tags.group_id_fk) join tags on (groups_tags.tag_id_fk=tags.tag_id) where tags.tag_name = :tagname having distance < :dist order by distance;");
    query.setParameter("lati", latitude);
    query.setParameter("longi", longitude);
    query.setParameter("tagname", tag);
    query.setParameter("dist", maxDistance);
    query.addScalar("group_id", StandardBasicTypes.INTEGER);
    query.addScalar("group_id", StandardBasicTypes.FLOAT);

    List<Object[]> closestGroups = query.list();

    if (closestGroups.isEmpty())
        return new ArrayList<>();

    ArrayList groupsToGet = new ArrayList<>();

    for (Object[] r : closestGroups) {
        int i = (int) r[0];
        groupsToGet.add(i);
    }

    Query getGroups = session.createQuery(
            "from Groups G left join fetch G.tagses left join fetch G.usersGroupses where G.groupId in (:ids)");
    getGroups.setParameterList("ids", groupsToGet);
    getGroups.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
    List<Groups> groupsFound = getGroups.list();

    ArrayList<SearchResult> results = new ArrayList<>();

    for (int i = 0; i < groupsFound.size(); i++) {
        SearchResult s = new SearchResult(groupsFound.get(i), (float) (closestGroups.get(i)[1]));
        results.add(s);
    }
    session.close();
    return results;
}

From source file:org.jboss.as.quickstart.hibernate4.util.vertica.VerticaDialect6.java

License:Open Source License

protected void registerFunctions() {
    registerFunction("abs", new StandardSQLFunction("abs"));
    registerFunction("sign", new StandardSQLFunction("sign", StandardBasicTypes.INTEGER));

    registerFunction("acos", new StandardSQLFunction("acos", StandardBasicTypes.DOUBLE));
    registerFunction("asin", new StandardSQLFunction("asin", StandardBasicTypes.DOUBLE));
    registerFunction("atan", new StandardSQLFunction("atan", StandardBasicTypes.DOUBLE));
    registerFunction("cos", new StandardSQLFunction("cos", StandardBasicTypes.DOUBLE));
    registerFunction("exp", new StandardSQLFunction("exp", StandardBasicTypes.DOUBLE));
    registerFunction("ln", new StandardSQLFunction("ln", StandardBasicTypes.DOUBLE));
    registerFunction("sin", new StandardSQLFunction("sin", StandardBasicTypes.DOUBLE));
    registerFunction("stddev", new StandardSQLFunction("stddev", StandardBasicTypes.DOUBLE));
    registerFunction("sqrt", new StandardSQLFunction("sqrt", StandardBasicTypes.DOUBLE));
    registerFunction("tan", new StandardSQLFunction("tan", StandardBasicTypes.DOUBLE));
    registerFunction("variance", new StandardSQLFunction("variance", StandardBasicTypes.DOUBLE));

    registerFunction("round", new StandardSQLFunction("round"));
    registerFunction("trunc", new StandardSQLFunction("trunc"));
    registerFunction("ceil", new StandardSQLFunction("ceil"));
    registerFunction("floor", new StandardSQLFunction("floor"));

    registerFunction("chr", new StandardSQLFunction("chr", StandardBasicTypes.CHARACTER));
    registerFunction("initcap", new StandardSQLFunction("initcap"));
    registerFunction("lower", new StandardSQLFunction("lower"));
    registerFunction("ltrim", new StandardSQLFunction("ltrim"));
    registerFunction("rtrim", new StandardSQLFunction("rtrim"));
    registerFunction("upper", new StandardSQLFunction("upper"));
    registerFunction("ascii", new StandardSQLFunction("ascii", StandardBasicTypes.INTEGER));

    registerFunction("to_char", new StandardSQLFunction("to_char", StandardBasicTypes.STRING));
    registerFunction("to_date", new StandardSQLFunction("to_date", StandardBasicTypes.TIMESTAMP));

    registerFunction("current_date", new NoArgSQLFunction("current_date", StandardBasicTypes.DATE, false));
    registerFunction("current_time", new NoArgSQLFunction("current_timestamp", StandardBasicTypes.TIME, false));
    registerFunction("current_timestamp",
            new NoArgSQLFunction("current_timestamp", StandardBasicTypes.TIMESTAMP, false));

    registerFunction("last_day", new StandardSQLFunction("last_day", StandardBasicTypes.DATE));
    registerFunction("sysdate", new NoArgSQLFunction("sysdate", StandardBasicTypes.DATE, false));
    registerFunction("user", new NoArgSQLFunction("user", StandardBasicTypes.STRING, false));

    // Multi-param string dialect functions...
    registerFunction("concat", new VarArgsSQLFunction(StandardBasicTypes.STRING, "", "||", ""));
    registerFunction("instr", new StandardSQLFunction("instr", StandardBasicTypes.INTEGER));
    registerFunction("instrb", new StandardSQLFunction("instrb", StandardBasicTypes.INTEGER));
    registerFunction("lpad", new StandardSQLFunction("lpad", StandardBasicTypes.STRING));
    registerFunction("replace", new StandardSQLFunction("replace", StandardBasicTypes.STRING));
    registerFunction("rpad", new StandardSQLFunction("rpad", StandardBasicTypes.STRING));
    registerFunction("substr", new StandardSQLFunction("substr", StandardBasicTypes.STRING));
    registerFunction("substrb", new StandardSQLFunction("substrb", StandardBasicTypes.STRING));
    registerFunction("translate", new StandardSQLFunction("translate", StandardBasicTypes.STRING));

    registerFunction("substring", new StandardSQLFunction("substr", StandardBasicTypes.STRING));
    registerFunction("bit_length", new SQLFunctionTemplate(StandardBasicTypes.INTEGER, "vsize(?1)*8"));
    registerFunction("coalesce", new NvlFunction());

    // Multi-param numeric dialect functions...
    registerFunction("atan2", new StandardSQLFunction("atan2", StandardBasicTypes.FLOAT));
    registerFunction("log", new StandardSQLFunction("log", StandardBasicTypes.INTEGER));
    registerFunction("mod", new StandardSQLFunction("mod", StandardBasicTypes.INTEGER));
    registerFunction("nvl", new StandardSQLFunction("nvl"));
    registerFunction("nvl2", new StandardSQLFunction("nvl2"));
    registerFunction("power", new StandardSQLFunction("power", StandardBasicTypes.FLOAT));

    // Multi-param date dialect functions...
    registerFunction("add_months", new StandardSQLFunction("add_months", StandardBasicTypes.DATE));
    registerFunction("months_between", new StandardSQLFunction("months_between", StandardBasicTypes.FLOAT));
    registerFunction("next_day", new StandardSQLFunction("next_day", StandardBasicTypes.DATE));

}

From source file:virtuoso.hibernate.VirtuosoDialect.java

License:Open Source License

public VirtuosoDialect() {
    super();//  w  w  w  . ja v a  2s .  c o m

    registerColumnType(Types.BIT, "SMALLINT");
    registerColumnType(Types.TINYINT, "SMALLINT");
    registerColumnType(Types.SMALLINT, "SMALLINT");
    registerColumnType(Types.INTEGER, "INTEGER");

    registerColumnType(Types.BIGINT, "DECIMAL(20,0)");

    registerColumnType(Types.REAL, "REAL");
    registerColumnType(Types.FLOAT, "FLOAT");
    registerColumnType(Types.DOUBLE, "DOUBLE PRECISION");
    registerColumnType(Types.NUMERIC, "DECIMAL($p, $s)");
    registerColumnType(Types.DECIMAL, "DECIMAL($p, $s)");
    registerColumnType(Types.BINARY, 2000, "BINARY($l)");
    registerColumnType(Types.VARBINARY, 2000, "VARBINARY($l)");
    registerColumnType(Types.LONGVARBINARY, "LONG VARBINARY");
    registerColumnType(Types.CHAR, 2000, "CHARACTER($l)");
    registerColumnType(Types.VARCHAR, 2000, "VARCHAR($l)");
    registerColumnType(Types.LONGVARCHAR, "LONG VARCHAR");
    registerColumnType(Types.DATE, "DATE");
    registerColumnType(Types.TIME, "TIME");
    registerColumnType(Types.TIMESTAMP, "DATETIME");

    registerColumnType(Types.BLOB, "LONG VARBINARY");
    registerColumnType(Types.CLOB, "LONG VARCHAR");

    ///===================

    registerFunction("iszero", new StandardSQLFunction("iszero", StandardBasicTypes.INTEGER));
    registerFunction("atod", new StandardSQLFunction("atod", StandardBasicTypes.DOUBLE));
    registerFunction("atof", new StandardSQLFunction("atof", StandardBasicTypes.FLOAT));
    registerFunction("atoi", new StandardSQLFunction("atoi", StandardBasicTypes.INTEGER));

    registerFunction("mod", new StandardSQLFunction("mod"));
    registerFunction("abs", new StandardSQLFunction("abs"));
    registerFunction("sign", new StandardSQLFunction("sign", StandardBasicTypes.DOUBLE));
    registerFunction("acos", new StandardSQLFunction("acos", StandardBasicTypes.DOUBLE));
    registerFunction("asin", new StandardSQLFunction("asin", StandardBasicTypes.DOUBLE));
    registerFunction("atan", new StandardSQLFunction("atan", StandardBasicTypes.DOUBLE));
    registerFunction("cos", new StandardSQLFunction("cos", StandardBasicTypes.DOUBLE));
    registerFunction("sin", new StandardSQLFunction("sin", StandardBasicTypes.DOUBLE));
    registerFunction("tan", new StandardSQLFunction("tan", StandardBasicTypes.DOUBLE));
    registerFunction("cot", new StandardSQLFunction("cot", StandardBasicTypes.DOUBLE));
    registerFunction("frexp", new StandardSQLFunction("frexp", StandardBasicTypes.DOUBLE));
    registerFunction("degrees", new StandardSQLFunction("degrees", StandardBasicTypes.DOUBLE));
    registerFunction("radians", new StandardSQLFunction("radians", StandardBasicTypes.DOUBLE));
    registerFunction("exp", new StandardSQLFunction("exp", StandardBasicTypes.DOUBLE));
    registerFunction("log", new StandardSQLFunction("log", StandardBasicTypes.DOUBLE));
    registerFunction("log10", new StandardSQLFunction("log10", StandardBasicTypes.DOUBLE));
    registerFunction("sqrt", new StandardSQLFunction("sqrt", StandardBasicTypes.DOUBLE));
    registerFunction("atan2", new StandardSQLFunction("atan2", StandardBasicTypes.DOUBLE));
    registerFunction("power", new StandardSQLFunction("power", StandardBasicTypes.DOUBLE));
    registerFunction("ceiling", new StandardSQLFunction("ceiling", StandardBasicTypes.INTEGER));
    registerFunction("floor", new StandardSQLFunction("floor", StandardBasicTypes.INTEGER));
    registerFunction("pi", new NoArgSQLFunction("pi", StandardBasicTypes.DOUBLE, true));
    registerFunction("round", new StandardSQLFunction("round", StandardBasicTypes.DOUBLE));
    registerFunction("rand", new StandardSQLFunction("rand"));
    registerFunction("rnd", new StandardSQLFunction("rnd"));
    registerFunction("randomize", new StandardSQLFunction("randomize"));

    registerFunction("hash", new StandardSQLFunction("hash", StandardBasicTypes.INTEGER));
    registerFunction("md5_box", new StandardSQLFunction("md5_box", StandardBasicTypes.STRING));
    registerFunction("box_hash", new StandardSQLFunction("box_hash", StandardBasicTypes.INTEGER));
    /* Bitwise: */
    registerFunction("bit_and", new StandardSQLFunction("bit_and", StandardBasicTypes.INTEGER));
    registerFunction("bit_or", new StandardSQLFunction("bit_or", StandardBasicTypes.INTEGER));
    registerFunction("bit_xor", new StandardSQLFunction("bit_xor", StandardBasicTypes.INTEGER));
    registerFunction("bit_not", new StandardSQLFunction("bit_not", StandardBasicTypes.INTEGER));
    registerFunction("bit_shift", new StandardSQLFunction("bit_shift", StandardBasicTypes.INTEGER));

    // undef=>TRUNCATE
    registerFunction("length", new StandardSQLFunction("length", StandardBasicTypes.INTEGER));
    registerFunction("char_length", new StandardSQLFunction("char_length", StandardBasicTypes.INTEGER));
    registerFunction("character_length",
            new StandardSQLFunction("character_length", StandardBasicTypes.INTEGER));
    registerFunction("octet_length", new StandardSQLFunction("octet_length", StandardBasicTypes.INTEGER));

    registerFunction("ascii", new StandardSQLFunction("ascii", StandardBasicTypes.INTEGER));
    registerFunction("chr", new StandardSQLFunction("chr", StandardBasicTypes.CHARACTER));
    registerFunction("chr1", new StandardSQLFunction("chr1", StandardBasicTypes.CHARACTER));
    registerFunction("subseq", new StandardSQLFunction("subseq", StandardBasicTypes.STRING));
    registerFunction("substring", new StandardSQLFunction("substring", StandardBasicTypes.STRING));
    registerFunction("left", new StandardSQLFunction("left", StandardBasicTypes.STRING));
    registerFunction("right", new StandardSQLFunction("right", StandardBasicTypes.STRING));
    registerFunction("ltrim", new StandardSQLFunction("ltrim", StandardBasicTypes.STRING));
    registerFunction("rtrim", new StandardSQLFunction("rtrim", StandardBasicTypes.STRING));
    registerFunction("trim", new StandardSQLFunction("trim", StandardBasicTypes.STRING));

    registerFunction("repeat", new StandardSQLFunction("repeat", StandardBasicTypes.STRING));
    registerFunction("space", new StandardSQLFunction("space", StandardBasicTypes.STRING));

    registerFunction("make_string", new StandardSQLFunction("make_string", StandardBasicTypes.STRING));
    registerFunction("make_wstring", new StandardSQLFunction("make_wstring", StandardBasicTypes.STRING));
    registerFunction("make_bin_string", new StandardSQLFunction("make_bin_string", StandardBasicTypes.BINARY));
    registerFunction("concatenate", new StandardSQLFunction("concatenate", StandardBasicTypes.STRING));

    registerFunction("concat", new StandardSQLFunction("concat", StandardBasicTypes.STRING));
    registerFunction("replace", new StandardSQLFunction("replace", StandardBasicTypes.STRING));

    registerFunction("sprintf", new StandardSQLFunction("sprintf", StandardBasicTypes.STRING));
    registerFunction("sprintf_or_null", new StandardSQLFunction("sprintf_or_null", StandardBasicTypes.STRING));
    registerFunction("sprintf_iri", new StandardSQLFunction("sprintf_iri", StandardBasicTypes.STRING));
    registerFunction("sprintf_iri_or_null",
            new StandardSQLFunction("sprintf_iri_or_null", StandardBasicTypes.STRING));

    registerFunction("strchr", new StandardSQLFunction("strchr", StandardBasicTypes.INTEGER));
    registerFunction("strrchr", new StandardSQLFunction("strrchr", StandardBasicTypes.INTEGER));
    registerFunction("strstr", new StandardSQLFunction("strstr", StandardBasicTypes.INTEGER));
    registerFunction("strindex", new StandardSQLFunction("strindex", StandardBasicTypes.INTEGER));
    registerFunction("strcasestr", new StandardSQLFunction("strcasestr", StandardBasicTypes.INTEGER));
    registerFunction("locate", new StandardSQLFunction("locate", StandardBasicTypes.INTEGER));
    registerFunction("matches_like", new StandardSQLFunction("matches_like", StandardBasicTypes.INTEGER));

    registerFunction("__like_min", new StandardSQLFunction("__like_min", StandardBasicTypes.STRING));
    registerFunction("__like_max", new StandardSQLFunction("__like_max", StandardBasicTypes.STRING));
    registerFunction("fix_identifier_case",
            new StandardSQLFunction("fix_identifier_case", StandardBasicTypes.STRING));
    registerFunction("casemode_strcmp", new StandardSQLFunction("casemode_strcmp", StandardBasicTypes.INTEGER));

    registerFunction("lcase", new StandardSQLFunction("lcase", StandardBasicTypes.STRING));
    registerFunction("lower", new StandardSQLFunction("lower", StandardBasicTypes.STRING));
    registerFunction("ucase", new StandardSQLFunction("ucase", StandardBasicTypes.STRING));
    registerFunction("upper", new StandardSQLFunction("upper", StandardBasicTypes.STRING));
    registerFunction("initcap", new StandardSQLFunction("initcap", StandardBasicTypes.STRING));

    registerFunction("table_type", new StandardSQLFunction("table_type", StandardBasicTypes.STRING));
    registerFunction("internal_type_name",
            new StandardSQLFunction("internal_type_name", StandardBasicTypes.STRING));
    registerFunction("internal_type", new StandardSQLFunction("internal_type", StandardBasicTypes.INTEGER));
    registerFunction("isinteger", new StandardSQLFunction("isinteger", StandardBasicTypes.INTEGER));
    registerFunction("isnumeric", new StandardSQLFunction("isnumeric", StandardBasicTypes.INTEGER));
    registerFunction("isfloat", new StandardSQLFunction("isfloat", StandardBasicTypes.INTEGER));
    registerFunction("isdouble", new StandardSQLFunction("isdouble", StandardBasicTypes.INTEGER));
    registerFunction("isnull", new StandardSQLFunction("isnull", StandardBasicTypes.INTEGER));
    registerFunction("isnotnull", new StandardSQLFunction("isnotnull", StandardBasicTypes.INTEGER));
    registerFunction("isblob", new StandardSQLFunction("isblob", StandardBasicTypes.INTEGER));
    registerFunction("isentity", new StandardSQLFunction("isentity", StandardBasicTypes.INTEGER));
    registerFunction("isstring", new StandardSQLFunction("isstring", StandardBasicTypes.INTEGER));
    registerFunction("isbinary", new StandardSQLFunction("isbinary", StandardBasicTypes.INTEGER));
    registerFunction("isarray", new StandardSQLFunction("isarray", StandardBasicTypes.INTEGER));
    registerFunction("isiri_id", new StandardSQLFunction("isiri_id", StandardBasicTypes.INTEGER));
    registerFunction("is_named_iri_id", new StandardSQLFunction("is_named_iri_id", StandardBasicTypes.INTEGER));
    registerFunction("is_bnode_iri_id", new StandardSQLFunction("is_bnode_iri_id", StandardBasicTypes.INTEGER));
    registerFunction("isuname", new StandardSQLFunction("isuname", StandardBasicTypes.INTEGER));

    registerFunction("username", new NoArgSQLFunction("username", StandardBasicTypes.STRING, true));
    registerFunction("dbname", new NoArgSQLFunction("dbname", StandardBasicTypes.STRING, true));
    registerFunction("ifnull", new VarArgsSQLFunction("ifnull(", ",", ")"));
    registerFunction("get_user", new NoArgSQLFunction("get_user", StandardBasicTypes.STRING, true));

    registerFunction("dayname", new StandardSQLFunction("dayname", StandardBasicTypes.STRING));
    registerFunction("monthname", new StandardSQLFunction("monthname", StandardBasicTypes.STRING));
    registerFunction("now", new NoArgSQLFunction("now", StandardBasicTypes.TIMESTAMP));
    registerFunction("curdate", new NoArgSQLFunction("curdate", StandardBasicTypes.DATE));
    registerFunction("dayofmonth", new StandardSQLFunction("dayofmonth", StandardBasicTypes.INTEGER));
    registerFunction("dayofweek", new StandardSQLFunction("dayofweek", StandardBasicTypes.INTEGER));
    registerFunction("dayofyear", new StandardSQLFunction("dayofyear", StandardBasicTypes.INTEGER));
    registerFunction("quarter", new StandardSQLFunction("quarter", StandardBasicTypes.INTEGER));
    registerFunction("week", new StandardSQLFunction("week", StandardBasicTypes.INTEGER));
    registerFunction("month", new StandardSQLFunction("month", StandardBasicTypes.INTEGER));
    registerFunction("year", new StandardSQLFunction("year", StandardBasicTypes.INTEGER));
    registerFunction("hour", new StandardSQLFunction("hour", StandardBasicTypes.INTEGER));
    registerFunction("minute", new StandardSQLFunction("minute", StandardBasicTypes.INTEGER));
    registerFunction("second", new StandardSQLFunction("second", StandardBasicTypes.INTEGER));
    registerFunction("timezone", new StandardSQLFunction("timezone", StandardBasicTypes.INTEGER));
    registerFunction("curtime", new StandardSQLFunction("curtime", StandardBasicTypes.TIME));
    registerFunction("getdate", new NoArgSQLFunction("getdate", StandardBasicTypes.TIMESTAMP));
    registerFunction("curdatetime", new NoArgSQLFunction("curdatetime", StandardBasicTypes.TIMESTAMP));

    registerFunction("datediff", new StandardSQLFunction("datediff", StandardBasicTypes.INTEGER));
    registerFunction("dateadd", new StandardSQLFunction("dateadd", StandardBasicTypes.TIMESTAMP));
    registerFunction("timestampdiff", new StandardSQLFunction("timestampdiff", StandardBasicTypes.INTEGER));
    registerFunction("timestampadd", new StandardSQLFunction("timestampadd", StandardBasicTypes.TIMESTAMP));

    //============================
    registerKeyword("top");
    registerKeyword("char");
    registerKeyword("int");
    registerKeyword("name");
    registerKeyword("string");
    registerKeyword("intnum");
    registerKeyword("approxnum");
    registerKeyword("ammsc");
    registerKeyword("parameter");
    registerKeyword("as");
    registerKeyword("or");
    registerKeyword("and");
    registerKeyword("not");
    registerKeyword("uminus");
    registerKeyword("all");
    registerKeyword("ammsc");
    registerKeyword("any");
    registerKeyword("attach");
    registerKeyword("asc");
    registerKeyword("authorization");
    registerKeyword("between");
    registerKeyword("by");
    registerKeyword("character");
    registerKeyword("check");
    registerKeyword("close");
    registerKeyword("commit");
    registerKeyword("continue");
    registerKeyword("create");
    registerKeyword("current");
    registerKeyword("cursor");
    registerKeyword("decimal");
    registerKeyword("declare");
    registerKeyword("default");
    registerKeyword("delete");
    registerKeyword("desc");
    registerKeyword("distinct");
    registerKeyword("double");
    registerKeyword("drop");
    registerKeyword("escape");
    registerKeyword("exists");
    registerKeyword("fetch");
    registerKeyword("float");
    registerKeyword("for");
    registerKeyword("foreign");
    registerKeyword("found");
    registerKeyword("from");
    registerKeyword("goto");
    registerKeyword("go");
    registerKeyword("grant ");
    registerKeyword("group");
    registerKeyword("having");
    registerKeyword("in");
    registerKeyword("index");
    registerKeyword("indicator");
    registerKeyword("insert");
    registerKeyword("integer");
    registerKeyword("into");
    registerKeyword("is");
    registerKeyword("key");
    registerKeyword("language");
    registerKeyword("like");
    registerKeyword("nullx");
    registerKeyword("numeric");
    registerKeyword("of");
    registerKeyword("on");
    registerKeyword("open");
    registerKeyword("option");
    registerKeyword("order");
    registerKeyword("precision");
    registerKeyword("primary");
    registerKeyword("privileges");
    registerKeyword("procedure");
    registerKeyword("public");
    registerKeyword("real");
    registerKeyword("references");
    registerKeyword("rollback");
    registerKeyword("schema");
    registerKeyword("select");
    registerKeyword("set");
    registerKeyword("smallint");
    registerKeyword("some");
    registerKeyword("sqlcode");
    registerKeyword("sqlerror");
    registerKeyword("table");
    registerKeyword("to");
    registerKeyword("union");
    registerKeyword("unique");
    registerKeyword("update");
    registerKeyword("user");
    registerKeyword("values");
    registerKeyword("view");
    registerKeyword("whenever");
    registerKeyword("where");
    registerKeyword("with");
    registerKeyword("work");
    registerKeyword("continues");
    registerKeyword("object_id");
    registerKeyword("under");
    registerKeyword("clustered");
    registerKeyword("varchar");
    registerKeyword("varbinary");
    registerKeyword("long");
    registerKeyword("replacing");
    registerKeyword("soft");
    registerKeyword("shutdown");
    registerKeyword("checkpoint");
    registerKeyword("backup");
    registerKeyword("replication");
    registerKeyword("sync");
    registerKeyword("alter");
    registerKeyword("add");
    registerKeyword("rename");
    registerKeyword("disconnect");
    registerKeyword("before");
    registerKeyword("after");
    registerKeyword("instead");
    registerKeyword("trigger");
    registerKeyword("referencing");
    registerKeyword("old");
    registerKeyword("procedure");
    registerKeyword("function");
    registerKeyword("out");
    registerKeyword("inout");
    registerKeyword("handler");
    registerKeyword("if");
    registerKeyword("then");
    registerKeyword("else");
    registerKeyword("elseif");
    registerKeyword("while");
    registerKeyword("beginx");
    registerKeyword("endx");
    registerKeyword("equals");
    registerKeyword("return");
    registerKeyword("call");
    registerKeyword("returns");
    registerKeyword("do");
    registerKeyword("exclusive");
    registerKeyword("prefetch");
    registerKeyword("sqlstate");
    registerKeyword("found");
    registerKeyword("revoke");
    registerKeyword("password");
    registerKeyword("off");
    registerKeyword("logx");
    registerKeyword("sqlstate");
    registerKeyword("timestamp");
    registerKeyword("date");
    registerKeyword("datetime");
    registerKeyword("time");
    registerKeyword("execute");
    registerKeyword("owner");
    registerKeyword("begin_fn_x");
    registerKeyword("begin_oj_x");
    registerKeyword("convert");
    registerKeyword("case");
    registerKeyword("when");
    registerKeyword("then");
    registerKeyword("identity");
    registerKeyword("left");
    registerKeyword("right");
    registerKeyword("full");
    registerKeyword("outer");
    registerKeyword("join");
    registerKeyword("use");

}