Examples of whereIn()


Examples of org.apache.torque.criteria.Criteria.whereIn()

    public void testInArray() throws Exception
    {
        Criteria criteria = new Criteria();
        criteria.addSelectColumn(new ColumnImpl("table.column1"));
        String[] inValue = new String[] {"a", "b", null, null};
        criteria.whereIn(new ColumnImpl("table.column2"), inValue.clone());

        Query query = SqlBuilder.buildQuery(criteria);

        assertEquals("SELECT table.column1 FROM table "
                + "WHERE (table.column2 IN (?,?) OR table.column2 IS NULL)",
View Full Code Here

Examples of org.apache.torque.criteria.Criteria.whereIn()

    public void testInArrayIgnoreCase() throws Exception
    {
        Criteria criteria = new Criteria();
        criteria.addSelectColumn(new ColumnImpl("table.column1"));
        String[] inValue = new String[] {"a", "b", null, null};
        criteria.whereIn(new ColumnImpl("table.column2"), inValue.clone());
        criteria.setIgnoreCase(true);

        Query query = SqlBuilder.buildQuery(criteria);

        assertEquals("SELECT table.column1 FROM table "
View Full Code Here

Examples of org.apache.torque.criteria.Criteria.whereIn()

        List<Integer> inList = new ArrayList<Integer>();
        inList.add(1);
        inList.add(null);
        inList.add(2);
        inList.add(null);
        criteria.whereIn(new ColumnImpl("table.column2"), inList);

        Query query = SqlBuilder.buildQuery(criteria);
        assertEquals("SELECT table.column1 FROM table "
                + "WHERE (table.column2 IN (?,?) OR table.column2 IS NULL)",
            query.toString());
View Full Code Here

Examples of org.apache.torque.criteria.Criteria.whereIn()

        List<String> inList = new ArrayList<String>();
        inList.add("a");
        inList.add("b");
        inList.add(null);
        inList.add(null);
        criteria.whereIn(new ColumnImpl("table.column2"), inList);
        criteria.setIgnoreCase(true);

        Query query = SqlBuilder.buildQuery(criteria);
        assertEquals("SELECT table.column1 FROM table "
                + "WHERE (UPPER(table.column2) IN (UPPER(?),UPPER(?))"
View Full Code Here

Examples of org.apache.torque.criteria.Criteria.whereIn()

        {
            Array.set(values, i, String.valueOf(i));
        }
        Criteria criteria = new Criteria();
        criteria.addSelectColumn(new ColumnImpl("table.column1"));
        criteria.whereIn(new ColumnImpl("table.column2"), values);
        long start = System.currentTimeMillis();
        Query query = SqlBuilder.buildQuery(criteria);
        long end =  System.currentTimeMillis();
        List<Object> replacements = query.getPreparedStatementReplacements();
        assertEquals(size, replacements.size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.