// 'base' property and make sure we only do that once
String baseName = propName.substring(0, basePos);
// make sure we only included the base/embedded bean once
if (!selectProps.containsProperty(baseName)) {
BeanProperty p = desc.findBeanProperty(baseName);
if (p == null) {
logger.error("property [" + propName + "] not found on " + desc + " for query - excluding it.");
} else if (p.isEmbedded()) {
// add the embedded bean (and effectively
// all its properties)
selectProps.add(p);
} else {
String m = "property [" + p.getFullBeanName() + "] expected to be an embedded bean for query - excluding it.";
logger.error(m);
}
}
} else {
// find the property including searching the
// sub class hierarchy if required
BeanProperty p = desc.findBeanProperty(propName);
if (p == null) {
logger.error("property [" + propName + "] not found on " + desc + " for query - excluding it.");
p = desc.findBeanProperty("id");
selectProps.add(p);
} else if (p.isId()) {
// do not bother to include id for normal queries as the
// id is always added (except for subQueries)
} else if (p instanceof BeanPropertyAssoc<?>) {
// need to check if this property should be
// excluded. This occurs when this property is
// included as a bean join. With a bean join
// the property should be excluded as the bean
// join has its own node in the SqlTree.
if (!queryProps.isIncludedBeanJoin(p.getName())) {
// include the property... which basically
// means include the foreign key column(s)
selectProps.add(p);
}
} else {