TypeDao { public List<TypeAttribute> getTypeAttributes(String typeName, String owner) { return jdbcTemplate.query( GET_TYPE_ATTRIBUTES, new Object[]{typeName.toUpperCase(), owner}, (resultSet, i) -> new TypeAttribute( resultSet.getString("attr_name"), resultSet.getString("attr_type_name"), resultSet.getInt("attr_no"), resultSet.getInt("data_scale"), resultSet.getInt("multi_type"), resultSet.getString("typecode"), resultSet.getString("collection_base_type") ) ); } TypeDao(DataSource dataSource); List<String> getTypeList(OBridgeConfiguration c); List<TypeAttribute> getTypeAttributes(String typeName, String owner); List<String> getEmbeddedTypeList(String owner); List<TypeAttribute> getEmbeddedTypeAttributes(String typeName, String owner);  }
@Test public void testGetTypeAttributes() { List<TypeAttribute> typeAttributes = typeDao.getTypeAttributes(SAMPLE_TYPE_ONE, "OBRIDGE"); Assert.assertEquals(9, typeAttributes.size()); Assert.assertEquals("attrVarchar", typeAttributes.get(0).getJavaPropertyName()); Assert.assertEquals("String", typeAttributes.get(0).getJavaDataType()); }
@Test public void testConverterMustache() { List<TypeAttribute> typeAttributes = typeDao.getTypeAttributes(SAMPLE_TYPE_ONE, "OBRIDGE"); Type t = new Type(); t.setTypeName(SAMPLE_TYPE_ONE); t.setAttributeList(typeAttributes); MustacheRunner.build("converter.mustache", t); }