private String createSelect() throws XavaException { if (hasBaseCondition()) { String baseCondition = getBaseCondition(); if (baseCondition.trim().toUpperCase().startsWith("SELECT ")) { return baseCondition; } } // basic select StringBuffer select = new StringBuffer("select "); Iterator itProperties = getPropertiesNames().iterator(); while (itProperties.hasNext()) { String property = (String) itProperties.next(); if (Strings.isModelName(property)) select.append("0"); // the property is a table name not column name else { select.append("${"); select.append(property); select.append('}'); } if (itProperties.hasNext()) select.append(", "); } Iterator itHiddenProperties = getHiddenPropertiesNames().iterator(); while (itHiddenProperties.hasNext()) { select.append(", "); select.append("${"); select.append(itHiddenProperties.next()); select.append('}'); } select.append(" from ${"); select.append(getModelName()); select.append('}'); select.append(' '); if (hasBaseCondition()) { select.append(" where "); select.append(getBaseCondition()); } return select.toString(); }