use of com.infiniteautomation.mango.db.query.SQLQueryColumn in project ma-core-public by infiniteautomation.
the class AbstractBasicDao method getQueryColumn.
/**
* @param argument
* @return
*/
public SQLQueryColumn getQueryColumn(String prop) {
boolean mapped = false;
Set<String> properties = this.propertyTypeMap.keySet();
String dbCol = prop;
Integer sqlType;
if (propertiesMap.containsKey(prop)) {
IntStringPair pair = propertiesMap.get(prop);
dbCol = pair.getValue();
sqlType = pair.getKey();
mapped = true;
} else {
sqlType = this.propertyTypeMap.get(dbCol);
}
if (mapped || properties.contains(dbCol)) {
if (mapped)
return new SQLQueryColumn(dbCol, sqlType);
else
return new SQLQueryColumn(this.tablePrefix + dbCol, sqlType);
}
// No Column matches...
throw new ShouldNeverHappenException("No column found for: " + prop);
}
Aggregations