use of org.geotoolkit.db.reverse.RelationMetaModel in project geotoolkit by Geomatys.
the class SQLQueryBuilder method encodeSelectColumnNames.
protected void encodeSelectColumnNames(StringBuilder sql, FeatureType featureType, Hints hints) {
for (PropertyType att : featureType.getProperties(true)) {
if (att instanceof DBRelationOperation) {
final RelationMetaModel relation = ((DBRelationOperation) att).getRelation();
final String str = att.getName().tip().toString();
if (relation.isImported()) {
dialect.encodeColumnName(sql, str);
} else {
// key is exported, it means the database field is in the other table.
continue;
}
} else if (att instanceof Operation || att instanceof FeatureAssociationRole || AttributeConvention.contains(att.getName())) {
continue;
} else if (AttributeConvention.isGeometryAttribute(att)) {
// encode as geometry
encodeGeometryColumn((AttributeType) att, sql, hints);
// alias it to be the name of the original geometry
dialect.encodeColumnAlias(sql, att.getName().tip().toString());
} else {
dialect.encodeColumnName(sql, att.getName().tip().toString());
}
sql.append(',');
}
sql.setLength(sql.length() - 1);
}
Aggregations