PojoMapper { public static Pojo typeToPojo(String typeName, List<TypeAttribute> typeAttributes) { Pojo p = new Pojo(); p.setClassName(StringHelper.toCamelCase(typeName)); p.setFields(new ArrayList<PojoField>()); for (TypeAttribute t : typeAttributes) { PojoField field = new PojoField(); field.setFieldName(StringHelper.toCamelCaseSmallBegin(t.getAttrName())); field.setFieldType(t.getJavaDataType()); field.setReadonly(false); p.getFields().add(field); } p.setImports(new ArrayList<String>()); p.getImports().add("java.sql.Timestamp"); p.getImports().add("java.sql.Date"); p.getImports().add("java.util.List"); p.getImports().add("java.math.BigDecimal"); return p; } private  PojoMapper(); static Pojo typeToPojo(String typeName, List<TypeAttribute> typeAttributes); static Pojo procedureToPojo(Procedure procedure);  }
@Test public void testToPojo() { Pojo pojo = PojoMapper.typeToPojo(SAMPLE_TYPE_ONE, typeDao.getTypeAttributes(SAMPLE_TYPE_ONE, "OBRIDGE")); Assert.assertEquals("SampleTypeOne", pojo.getClassName()); Assert.assertEquals(9, pojo.getFields().size()); for (PojoField f : pojo.getFields()) { Assert.assertFalse(f.isReadonly()); } MustacheRunner.build("pojo.mustache", pojo); }