Example usage for org.hibernate.type StandardBasicTypes STRING

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

Introduction

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

Prototype

StringType STRING

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

Click Source Link

Document

The standard Hibernate type for mapping String to JDBC java.sql.Types#VARCHAR VARCHAR .

Usage

From source file:ru.trett.cis.DAO.AssetDAOImpl.java

License:Open Source License

@Override
@SuppressWarnings("unchecked")
public List<ResultMapper> assetGroupByStatusAndCount() {
    Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Asset.class);
    return criteria
            .setProjection(Projections.projectionList()
                    .add(Projections.sqlGroupProjection("status as st", "st", new String[] { "st" },
                            new Type[] { StandardBasicTypes.STRING }), "name")
                    .add(Projections.rowCount(), "data"))
            .setResultTransformer(Transformers.aliasToBean(ResultMapper.class)).list();
}

From source file:ru.trett.cis.DAO.InvoiceDAOImpl.java

License:Open Source License

@Override
@SuppressWarnings("unchecked")
public List<ResultMapper> recordsPerDay() {
    Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Invoice.class);
    return criteria
            .setProjection(Projections.projectionList()
                    .add(Projections.sqlGroupProjection("date(date) as creationDate", "creationDate",
                            new String[] { "creationDate" }, new Type[] { StandardBasicTypes.STRING }), "name")
                    .add(Projections.rowCount(), "data"))
            .setResultTransformer(Transformers.aliasToBean(ResultMapper.class)).setCacheable(true).list();
}

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:ume.pareva.it.ITDr.java

private void processITDR(MobileClub club, String msisdn, String messageId, String logUnique, String statusText,
        String reasonCode, String statusCode, String reasonText) {

    Transaction dbtransaction = null;//w  w  w .j a v  a 2  s . com
    Session dbsession = null;
    Calendar nowTime = GregorianCalendar.getInstance();
    nowTime.setTimeZone(TimeZone.getTimeZone("Europe/Rome"));
    Date currentDate = nowTime.getTime();

    String billCreated = "1970-01-01 00:00:00";
    clubUser = null;
    MobileClubBillingPlan billingPlan = null;
    if (msisdn.equals("")) {
        clubUser = umeMobileClubUserDao.getClubUserByMsisdn(msisdn, club.getUnique());
    }

    //IF CLUBUSER IS ON PAREVA DOING BILLING LOGIC, ELSE REDIRECT TO MIXEM PLATFORM.
    if (clubUser != null) {
        dbtransaction = dbsession.beginTransaction();
        Query query = null;

        try {
            String checktidQuery = "select * from itNotificationLog where aUnique='" + messageId + "'";
            query = dbsession.createSQLQuery(checktidQuery).addScalar("aUnique", StandardBasicTypes.STRING);

            java.util.List result = query.list();

            if (result != null && result.size() > 0) {
            } else {

                String addNotificationLogQuery = " INSERT INTO itNotificationLog" + " (aUnique)" + " VALUES('"
                        + messageId + "')";
                try {
                    query = dbsession.createSQLQuery(addNotificationLogQuery);
                    query.executeUpdate();
                } catch (Exception e) {
                    System.out.println("iminotification_debug " + " Exception " + e);
                    e.printStackTrace();
                }

                try {
                    MobileClubBillingTry item = new MobileClubBillingTry();
                    item.setUnique(Misc.generateUniqueId());
                    item.setLogUnique(logUnique);
                    item.setAggregator("ipx");
                    item.setStatus(statusText);
                    item.setTransactionId(clubUser.getParam2());
                    item.setResponseRef(messageId);
                    item.setResponseCode(reasonCode);
                    item.setResponseDesc(reasonText);
                    item.setCreated(currentDate);
                    item.setRegionCode("IT");
                    item.setNetworkCode(clubUser.getNetworkCode());
                    item.setParsedMsisdn(clubUser.getParsedMobile());
                    item.setTariffClass(250);
                    item.setBillingType("club");
                    item.setClubUnique(clubUser.getClubUnique());
                    item.setCampaign(clubUser.getCampaign());
                    item.setTicketCreated(SdcMiscDate.parseSqlDateString(billCreated));

                    processBillingPlan(statusCode, reasonCode, reasonText, messageId, clubUser, item);

                } catch (Exception eeee) {
                    System.out.println("IPX oooo notify charged: " + eeee);
                }
            }

        } catch (Exception ee) {
            System.out.println("IPX itNotificationLog checking exception charged: " + ee);
        }
    }
}

From source file:virtuoso.hibernate.VirtuosoDialect.java

License:Open Source License

public VirtuosoDialect() {
    super();//www  .j  a  va 2 s.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");

}

From source file:wicket.contrib.phonebook.HibernateContactFinderQueryBuilder.java

License:Apache License

private void addMatchingCondition(StringBuilder hql, String value, String name) {
    if (value != null) {
        hql.append("and upper(target.");
        hql.append(name);/*from  w ww  .  j  a  v a 2s.co m*/
        hql.append(") like (?)");
        parameters.add("%" + value.toUpperCase() + "%");
        types.add(StandardBasicTypes.STRING);
    }
}

From source file:wicket.contrib.phonebook.HibernateContactFinderQueryBuilderTest.java

License:Apache License

@Test
public void testFiltersByFirstName() throws Exception {
    filter.setFirstname("James");
    assertTrue(builder.buildHql().endsWith("and upper(target.firstname) like (?)"));
    assertEquals("%JAMES%", builder.getParameters()[0]);
    assertEquals(StandardBasicTypes.STRING, builder.getTypes()[0]);
}

From source file:wicket.contrib.phonebook.HibernateContactFinderQueryBuilderTest.java

License:Apache License

@Test
public void testFiltersByLastName() throws Exception {
    filter.setLastname("Bond");
    assertTrue(builder.buildHql().endsWith("and upper(target.lastname) like (?)"));
    assertEquals("%BOND%", builder.getParameters()[0]);
    assertEquals(StandardBasicTypes.STRING, builder.getTypes()[0]);
}

From source file:wicket.contrib.phonebook.HibernateContactFinderQueryBuilderTest.java

License:Apache License

@Test
public void testFiltersByPhone() throws Exception {
    filter.setPhone("+12345");
    assertTrue(builder.buildHql().endsWith("and upper(target.phone) like (?)"));
    assertEquals("%+12345%", builder.getParameters()[0]);
    assertEquals(StandardBasicTypes.STRING, builder.getTypes()[0]);
}

From source file:wicket.contrib.phonebook.HibernateContactFinderQueryBuilderTest.java

License:Apache License

@Test
public void testFiltersByEmail() throws Exception {
    filter.setEmail("james@bond.com");
    assertTrue(builder.buildHql().endsWith("and upper(target.email) like (?)"));
    assertEquals("%JAMES@BOND.COM%", builder.getParameters()[0]);
    assertEquals(StandardBasicTypes.STRING, builder.getTypes()[0]);
}