Package de.zalando.typemapper.namedresult.results

Examples of de.zalando.typemapper.namedresult.results.ClassWithObjectWithObject


                "SELECT 'str' as str, ROW(ROW(1,2,'c')::tmp.simple_type,'str')::tmp.complex_type as obj");
        final ResultSet rs = ps.executeQuery();
        final TypeMapper<?> mapper = TypeMapperFactory.createTypeMapper(ClassWithObjectWithObject.class);
        int i = 0;
        while (rs.next()) {
            final ClassWithObjectWithObject result = (ClassWithObjectWithObject) mapper.mapRow(rs, i++);
            Assert.assertEquals("str", result.getStr());
            Assert.assertNotNull(result.getWithObj());
            Assert.assertEquals("str", result.getWithObj().getStr());
            Assert.assertNotNull("str", result.getWithObj().getPrimitives());
            Assert.assertEquals('c', result.getWithObj().getPrimitives().getC());
            Assert.assertEquals(2, result.getWithObj().getPrimitives().getL());
            Assert.assertEquals(1, result.getWithObj().getPrimitives().getI());
        }

    }
View Full Code Here


                "SELECT 'str' as str, ROW(null,'str')::tmp.complex_type as obj");
        final ResultSet rs = ps.executeQuery();
        final TypeMapper<?> mapper = TypeMapperFactory.createTypeMapper(ClassWithObjectWithObject.class);
        int i = 0;
        while (rs.next()) {
            final ClassWithObjectWithObject result = (ClassWithObjectWithObject) mapper.mapRow(rs, i++);
            Assert.assertEquals("str", result.getStr());
            Assert.assertNotNull(result.getWithObj());
            Assert.assertEquals("str", result.getWithObj().getStr());
            Assert.assertNull(result.getWithObj().getPrimitives());
        }

    }
View Full Code Here

TOP

Related Classes of de.zalando.typemapper.namedresult.results.ClassWithObjectWithObject

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.