com.jpattern.orm.query.clause.OrmSelectClause Maven / Gradle / Ivy
package com.jpattern.orm.query.clause;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.jpattern.orm.query.INameSolver;
import com.jpattern.orm.query.IQueryRoot;
import com.jpattern.orm.query.NullNameSolver;
import com.jpattern.orm.query.select.ISelectRegexPattern;
/**
*
* @author Francesco Cina
*
* 07/lug/2011
*/
public class OrmSelectClause implements SelectClause {
// private static Pattern patternSelectClause = Pattern.compile(ISelectRegexPattern.SQL_SELECT_SPLIT_PATTERN);
private static Pattern patternProperty = Pattern.compile(ISelectRegexPattern.SQL_SELECT_PROPERTY_PATTERN);
private final String selectClause;
private INameSolver nameSolver = new NullNameSolver();
private final T query;
public OrmSelectClause(String selectClause, T query) {
this.selectClause = selectClause;
this.query = query;
}
@Override
public String renderSql() {
final StringBuilder query = new StringBuilder();
renderSql(query);
return query.toString();
}
@Override
public void renderSql(StringBuilder StringBuilder) {
// List tokens = splitSelect(selectClause);
// if (tokens.size()>0) {
// StringBuilder.append("SELECT ");
// for ( int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy