Package org.apache.cayenne

Examples of org.apache.cayenne.DataRow


        Integer integerValue = 54235;
        test.setIntegerColumn(integerValue);
        context.commitChanges();

        NamedQuery q = new NamedQuery("SelectReturnTypesMap1");
        DataRow testRead = (DataRow) context.performQuery(q).get(0);
        Object columnValue = testRead.get(columnName);
        assertNotNull(columnValue);
        assertEquals(Integer.class, columnValue.getClass());
        assertEquals(integerValue, columnValue);
    }
View Full Code Here


        };
        test.setLongvarbinaryColumn(longvarbinaryValue);
        context.commitChanges();

        NamedQuery q = new NamedQuery("SelectReturnTypesMap2");
        DataRow testRead = (DataRow) context.performQuery(q).get(0);
        Object columnValue = testRead.get(columnName);
        assertNotNull(columnValue);
        assertEquals(byte[].class, columnValue.getClass());
        assertTrue(Arrays.equals(longvarbinaryValue, (byte[]) columnValue));
    }
View Full Code Here

        String longvarcharValue = buffer.toString();
        test.setLongvarcharColumn(longvarcharValue);
        context.commitChanges();

        NamedQuery q = new NamedQuery("SelectReturnTypesMap1");
        DataRow testRead = (DataRow) context.performQuery(q).get(0);
        Object columnValue = testRead.get(columnName);
        assertNotNull(columnValue);
        assertEquals(String.class, columnValue.getClass());
        assertEquals(longvarcharValue, columnValue);
    }
View Full Code Here

        BigDecimal numericValue = new BigDecimal("578438.57843");
        test.setNumericColumn(numericValue);
        context.commitChanges();

        NamedQuery q = new NamedQuery("SelectReturnTypesMap1");
        DataRow testRead = (DataRow) context.performQuery(q).get(0);
        Object columnValue = testRead.get(columnName);
        assertNotNull(columnValue);
        assertEquals(BigDecimal.class, columnValue.getClass());
        assertEquals(numericValue, columnValue);
    }
View Full Code Here

        Float realValue = 5788.57843f;
        test.setRealColumn(realValue);
        context.commitChanges();

        NamedQuery q = new NamedQuery("SelectReturnTypesMap1");
        DataRow testRead = (DataRow) context.performQuery(q).get(0);
        Object columnValue = testRead.get(columnName);
        assertNotNull(columnValue);
        assertEquals(Float.class, columnValue.getClass());
        assertEquals(realValue, columnValue);
    }
View Full Code Here

        Short smallintValue = 32564;
        test.setSmallintColumn(smallintValue);
        context.commitChanges();

        NamedQuery q = new NamedQuery("SelectReturnTypesMap1");
        DataRow testRead = (DataRow) context.performQuery(q).get(0);
        Object columnValue = testRead.get(columnName);
        assertNotNull(columnValue);
        assertEquals(Short.class, columnValue.getClass());
        assertEquals(smallintValue, columnValue);
    }
View Full Code Here

        Date timeValue = new Time(cal.getTime().getTime());
        test.setTimeColumn(timeValue);
        context.commitChanges();

        NamedQuery q = new NamedQuery("SelectReturnTypesMap1");
        DataRow testRead = (DataRow) context.performQuery(q).get(0);
        Object columnValue = testRead.get(columnName);
        assertNotNull(columnValue);
        assertEquals(Date.class, columnValue.getClass());
        assertEquals(timeValue.toString(), new Time(((Date) columnValue).getTime())
                .toString());
    }
View Full Code Here

        Time now = new Time(cal.getTime().getTime());
        test.setTimeColumn(now);
        context.commitChanges();

        NamedQuery q = new NamedQuery("SelectDateTest");
        DataRow testRead = (DataRow) context.performQuery(q).get(0);
        Date columnValue = (Date) testRead.get("TIME_COLUMN");
        assertNotNull(columnValue);
        assertEquals(now.toString(), new Time(columnValue.getTime()).toString());
    }
View Full Code Here

        Date timestampValue = Calendar.getInstance().getTime();
        test.setTimestampColumn(timestampValue);
        context.commitChanges();

        NamedQuery q = new NamedQuery("SelectReturnTypesMap1");
        DataRow testRead = (DataRow) context.performQuery(q).get(0);
        Object columnValue = testRead.get(columnName);
        assertNotNull(columnValue);
        assertEquals(Date.class, columnValue.getClass());
        assertEquals(timestampValue.toString(), columnValue.toString());
    }
View Full Code Here

        Byte tinyintValue = 89;
        test.setTinyintColumn(tinyintValue);
        context.commitChanges();

        NamedQuery q = new NamedQuery("SelectReturnTypesMap1");
        DataRow testRead = (DataRow) context.performQuery(q).get(0);
        Object columnValue = testRead.get(columnName);
        assertNotNull(columnValue);
        assertTrue(Short.class.equals(columnValue.getClass()));
        assertEquals(tinyintValue.intValue(), ((Number)columnValue).intValue());
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.DataRow

Copyright © 2018 www.massapicom. 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.