use of com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF in project geoprism-registry by terraframe.
the class VectorTileBuilder method getResultSet.
private ResultSet getResultSet() {
MdBusinessDAOIF mdBusiness = MdBusinessDAO.get(this.version.getMdBusinessOid());
MdAttributeConcreteDAOIF geomAttribute = mdBusiness.definesAttribute(RegistryConstants.GEOMETRY_ATTRIBUTE_NAME);
MdAttributeConcreteDAOIF labelAttribute = mdBusiness.definesAttribute(DefaultAttribute.DISPLAY_LABEL.getName() + MasterListVersion.DEFAULT_LOCALE);
String column = geomAttribute.getColumnName();
String labelColumn = labelAttribute.getColumnName();
StringBuilder sql = new StringBuilder();
sql.append("SELECT ge.oid");
sql.append(", ge.uid");
sql.append(", ge.code");
sql.append(", ge." + labelColumn + " AS default_locale");
for (Locale locale : locales) {
MdAttributeConcreteDAOIF localeAttribute = mdBusiness.definesAttribute(DefaultAttribute.DISPLAY_LABEL.getName() + locale.toString());
if (localeAttribute != null) {
sql.append(", ge." + localeAttribute.getColumnName() + " AS " + locale.toString());
}
}
sql.append(", ST_Transform(ge." + column + ", 3857) AS " + GeoserverFacade.GEOM_COLUMN + "\n ");
sql.append("FROM " + mdBusiness.getTableName() + " AS ge\n ");
sql.append("WHERE ge." + column + " IS NOT NULL\n ");
sql.append("AND ge.invalid=0");
return Database.query(sql.toString());
}
Aggregations