Example usage for org.hibernate.type StandardBasicTypes INTEGER

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

Introduction

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

Prototype

IntegerType INTEGER

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

Click Source Link

Document

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

Usage

From source file:org.openmrs.hl7.db.hibernate.HibernateHL7DAO.java

License:Mozilla Public License

/**
 * @see org.openmrs.hl7.db.HL7DAO#getHL7InQueueByState(Integer stateId)
 *//*from   ww w  .j a  v a  2  s .  co  m*/
@SuppressWarnings("unchecked")
public List<HL7InQueue> getHL7InQueueByState(Integer state) throws DAOException {
    return sessionFactory.getCurrentSession().createQuery("from HL7InQueue where messageState = ?")
            .setParameter(0, state, StandardBasicTypes.INTEGER).list();
}

From source file:org.optaplanner.persistence.jpa.impl.score.buildin.bendable.BendableScoreHibernateType.java

License:Apache License

@Override
public void setParameterValues(Properties parameterMap) {
    int hardLevelsSize = extractIntParameter(parameterMap, "hardLevelsSize");
    int softLevelsSize = extractIntParameter(parameterMap, "softLevelsSize");
    scoreDefinition = new BendableScoreDefinition(hardLevelsSize, softLevelsSize);
    type = StandardBasicTypes.INTEGER;
}

From source file:org.optaplanner.persistence.jpa.impl.score.buildin.hardmediumsoft.HardMediumSoftScoreHibernateType.java

License:Apache License

public HardMediumSoftScoreHibernateType() {
    scoreDefinition = new HardMediumSoftScoreDefinition();
    type = StandardBasicTypes.INTEGER;
}

From source file:org.optaplanner.persistence.jpa.impl.score.buildin.hardsoft.HardSoftScoreHibernateType.java

License:Apache License

public HardSoftScoreHibernateType() {
    scoreDefinition = new HardSoftScoreDefinition();
    type = StandardBasicTypes.INTEGER;
}

From source file:org.optaplanner.persistence.jpa.impl.score.buildin.simple.SimpleScoreHibernateType.java

License:Apache License

public SimpleScoreHibernateType() {
    scoreDefinition = new SimpleScoreDefinition();
    type = StandardBasicTypes.INTEGER;
}

From source file:org.traffic.database.StreetPreparer.java

License:Open Source License

/**
 * Creates instances of the class/*from  www.  j a  v  a  2  s. c  o  m*/
 * {@link org.traffic.models.traffic.RoadStrip} by calculating intersection
 * points of a new road with all other new roads and the already saved
 * roads.
 * <p>
 * This method needs an installed version of PostGIS 2.0 or later!
 */
@SuppressWarnings("unchecked")
private static void createRoadStrips() {
    Session s = Database.session();
    s.beginTransaction();
    List<Integer> ids = (List<Integer>) s.createSQLQuery("SELECT id FROM data.osmlines")
            .addScalar("id", StandardBasicTypes.INTEGER).list();
    for (Integer i : ids) {
        // calculate intersection points with other new linetrings
        List<Geometry> geoms = (List<Geometry>) s
                .createSQLQuery("SELECT (St_Dump(ST_Intersection(o.way, c.way))).geom AS geom "
                        + "FROM data.osmlines o, data.osmlines c " + "WHERE o.id = " + i
                        + " AND o.name <> c.name " + "AND (ST_Crosses(o.way, c.way) "
                        + "OR ST_Touches(o.way, c.way))")
                .addScalar("geom", GeometryUserType.TYPE).list();

        // strip the linestrings with the calculated points
        for (Geometry g : geoms) {
            s.createSQLQuery(
                    "UPDATE data.osmlines SET way = ST_CollectionExtract(ST_Split(way, :g),2) WHERE id = " + i)
                    .setParameter("g", g).executeUpdate();
        }

        // calculate intersection points with other old linetrings
        geoms = (List<Geometry>) s
                .createSQLQuery("SELECT (St_Dump(ST_Intersection(o.way, c.way))).geom AS geom "
                        + "FROM data.osmlines o, data.roadstrips c " + "WHERE o.id = " + i + " "
                        + "AND (ST_Crosses(o.way, c.way) " + "OR ST_Touches(o.way, c.way))")
                .addScalar("geom", GeometryUserType.TYPE).list();

        // strip the linestrings with the calculated points
        for (Geometry g : geoms) {
            s.createSQLQuery(
                    "UPDATE data.osmlines SET way = ST_CollectionExtract(ST_Split(way, :g),2) WHERE id = " + i)
                    .setParameter("g", g).executeUpdate();
        }

        // saving the whole bunch as roadstrips
        s.createSQLQuery("INSERT INTO data.roadstrips(id, road_id, way) "
                + "SELECT nextval('data.strips_id_seq'), id, (ST_Dump(way)).geom "
                + "FROM data.osmlines WHERE id = " + i).executeUpdate();
    }
    Database.end(true);
}

From source file:org.traffic.services.FindRecurringProblemsService.java

License:Open Source License

@SuppressWarnings("unchecked")
@Override/*from  w ww .  j ava  2 s  .com*/
protected void serve() {
    Session s = Database.session();
    s.beginTransaction();

    Map<AVGMeasurement, Boolean> processed = new HashMap<AVGMeasurement, Boolean>();

    // finding all problems, which are identified almost twice
    List<Object[]> l = (List<Object[]>) s
            .createSQLQuery("SELECT road_id, dow, hour " + "FROM data.avg_speed_per_time "
                    + "WHERE maxspeed * 0.8 > speed " + "GROUP BY road_id, dow, hour " + "HAVING Count(*) > 1")
            .addScalar("road_id", StandardBasicTypes.INTEGER).addScalar("dow", StandardBasicTypes.INTEGER)
            .addScalar("hour", StandardBasicTypes.INTEGER).list();
    for (Object[] o : l) {
        processed.put(new AVGMeasurement((Integer) o[1], (Integer) o[2], (Integer) o[0]), false);
    }

    Map<List<Integer>, AVGMeasurement> spaces = new HashMap<List<Integer>, AVGMeasurement>();

    // finding all problems who affect more than one roadstrip
    for (AVGMeasurement a : processed.keySet()) {
        if (processed.get(a)) {
            continue;
        }
        List<Integer> roadstrips = new LinkedList<Integer>();
        RoadStrip r = (RoadStrip) s.load(RoadStrip.class, a.getRoad_id());
        roadstrips.add(a.getRoad_id());
        processed.put(a, true);

        // finding neighbours in a 5 km radius - same dow, same time
        List<Object[]> neighbours = (List<Object[]>) s.createSQLQuery("SELECT a.road_id, a.dow, a.hour "
                + "FROM data.avg_speed_per_time a " + "INNER JOIN data.roadstrips rs ON a.road_id = rs.id "
                + "WHERE a.maxspeed * 0.8 > a.speed and a.dow = :dow and a.hour = :hour and a.road_id <> :road "
                + "      and ST_DWithin(rs.way, GeometryFromText('" + r.getWay().toString()
                + "', 4326), 0.074) " + "GROUP BY a.road_id, a.dow, a.hour " + "HAVING Count(*) > 1")
                .addScalar("road_id", StandardBasicTypes.INTEGER).addScalar("dow", StandardBasicTypes.INTEGER)
                .addScalar("hour", StandardBasicTypes.INTEGER).setParameter("dow", a.getDow())
                .setParameter("hour", a.getHour()).setParameter("road", a.getRoad_id()).list();

        // making lists and mark the processed avgs
        for (Object[] o : neighbours) {
            AVGMeasurement avg = new AVGMeasurement((Integer) o[1], (Integer) o[2], (Integer) o[0]);
            roadstrips.add(avg.getRoad_id());
            processed.put(avg, true);
        }

        // finding same problem at another dow
        Collections.sort(roadstrips);
        AVGMeasurement done = (AVGMeasurement) spaces.get(roadstrips);
        if (done != null) {
            done.getTmpDows().add(a.getDow());
            spaces.put(roadstrips, done);
        } else {
            spaces.put(roadstrips, a);
        }
    }

    // creating the recognized Problems
    for (Map.Entry<List<Integer>, AVGMeasurement> entry : spaces.entrySet()) {
        Problem p = new Problem(entry.getValue().getHour(), entry.getKey().toString());
        int id = entry.getKey().get((int) (Math.random() * entry.getKey().size()));
        RoadStrip rs = (RoadStrip) s.load(RoadStrip.class, id);
        Coordinate c = rs.getWay().getCoordinateN((int) (Math.random() * rs.getWay().getNumPoints()));
        String cloudmade = IConstants.CM_GEOCODING + c.y + "," + c.x;
        String street = null;
        try {
            // getting the name of an affected street
            JSONObject jAnswer = JSONObject.fromObject(SocketCommunicator.getContent(cloudmade, "UTF8"));
            JSONArray jFeatures = jAnswer.getJSONArray("features");
            street = jFeatures.getJSONObject(0).getJSONObject("properties").getString("name");
        } catch (Exception e) {
            Log.e("FindRecurringProblemsService", e.getClass() + "@serve: " + e.getMessage());
        }

        // generating a description and saving the problem
        p.generateDescription(entry.getValue().getAllDows(), street);
        int entries = s.createCriteria(Problem.class).add(Restrictions.eq("hour", p.getHour()))
                .add(Restrictions.eq("regionJSON", p.getRegionJSON())).list().size();
        if (entries == 0) {
            s.save(p);
        }
    }
    Database.end(true);
}

From source file:org.traffic.services.UpdateSpeedService.java

License:Open Source License

@SuppressWarnings("unchecked")
@Override/*from   w  w w . j av  a 2 s.c  om*/
protected void serve() {
    Session s = Database.session();
    s.beginTransaction();
    // getting all strips with more than MINIMAL_MESSAGES_TOTAL messages
    List<Object[]> strips = (List<Object[]>) s
            .createSQLQuery("SELECT r.id, Count(*) AS count " + "FROM data.roadstrips r "
                    + "INNER JOIN data.userdata u ON u.road_id = r.id "
                    + "WHERE ST_Distance(ST_StartPoint(r.way), u.position) > :distance "
                    + "OR st_distance(ST_endPoint(r.way), u.position) > :distance " + "GROUP BY r.id "
                    + "HAVING Count(*) >= :min")
            .addScalar("id", StandardBasicTypes.INTEGER).addScalar("count", StandardBasicTypes.INTEGER)
            .setParameter("min", MINIMAL_MESSAGES_TOTAL).setParameter("distance", MINIMAL_DISTANCE).list();
    for (Object[] o : strips) {
        int total = (Integer) o[1];

        // getting the messages for each range
        List<Object[]> speeds = (List<Object[]>) s
                .createSQLQuery("SELECT tmp.road_id, tmp.range, Count(*) AS count "
                        + "FROM (SELECT u.road_id, CASE " + "WHEN u.speed BETWEEN 0 AND 20 THEN 10 "
                        + "WHEN u.speed BETWEEN 20 AND 40 THEN 30 " + "WHEN u.speed BETWEEN 40 AND 60 THEN 50 "
                        + "WHEN u.speed BETWEEN 60 AND 85 THEN 70 "
                        + "WHEN u.speed BETWEEN 85 AND 110 THEN 100 " + "ELSE 110 END AS range "
                        + "FROM data.roadstrips r "
                        + "INNER JOIN data.userdata u ON u.road_id = r.id WHERE u.road_id = " + (Integer) o[0]
                        + " AND (ST_Distance(ST_StartPoint(r.way), u.position) > " + MINIMAL_DISTANCE
                        + " OR st_distance(ST_endPoint(r.way), u.position) > " + MINIMAL_DISTANCE + ") ) tmp "
                        + "GROUP BY tmp.road_id, tmp.range")
                .addScalar("road_id", StandardBasicTypes.INTEGER).addScalar("range", StandardBasicTypes.INTEGER)
                .addScalar("count", StandardBasicTypes.INTEGER).list();

        // storing ranges with more than MINIMAL_MESSAGES_BORDER messages
        Map<Integer, Double> amountMessages = new HashMap<Integer, Double>();
        Integer speedlimit = null;
        for (Object[] messages : speeds) {
            int amount = (Integer) messages[2];
            if (amount >= MINIMAL_MESSAGES_BORDER) {
                amountMessages.put((Integer) messages[1], (1.0 * amount / total));
                if ((1.0 * amount / total) > PERCENTAGE_BORDER)
                    speedlimit = (Integer) messages[1];
            }

        }

        // checking the distance between the measures
        if (speedlimit == null && amountMessages.size() > 1) {
            for (Map.Entry<Integer, Double> entryX : amountMessages.entrySet()) {
                boolean check = true;
                for (Map.Entry<Integer, Double> entryY : amountMessages.entrySet()) {
                    if (entryX.getKey() != entryY.getKey()
                            && entryX.getValue() < (entryY.getValue() + PERCENTAGE_DISTANCE)) {
                        check = false;
                    }
                }

                if (check) {
                    speedlimit = entryX.getKey();
                    break;
                }

            }

            // selecting the smallest value
            if (speedlimit == null) {
                speedlimit = Collections.min(amountMessages.keySet());
            }
        }

        // save the value and set the flag
        if (speedlimit != null) {
            RoadStrip rs = (RoadStrip) s.load(RoadStrip.class, (Integer) o[0]);
            Road r = rs.getRoad();
            if (r.getCalculated() == null || r.getCalculated()) {
                r.setMaxspeed(speedlimit);
                s.save(r);
            }
        }
    }
    Database.end(true);
}

From source file:sam_testclient.utilities.SQLiteDialect.java

public SQLiteDialect() {
    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(StandardBasicTypes.STRING, "", "||", ""));
    registerFunction("mod", new SQLFunctionTemplate(StandardBasicTypes.INTEGER, "?1 % ?2"));
    registerFunction("substr", new StandardSQLFunction("substr", StandardBasicTypes.STRING));
    registerFunction("substring", new StandardSQLFunction("substr", StandardBasicTypes.STRING));
}

From source file:virtuoso.hibernate.VirtuosoDialect.java

License:Open Source License

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

    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");

}