com.github.napp.database.impl.Query Maven / Gradle / Ivy
/**
*
*/
package com.github.napp.database.impl;
import com.github.napp.database.IEntity;
/**
* @author Alexandru Bledea
* @since Sep 21, 2013
*/
abstract class Query extends BaseQuery {
protected static final String PLACEHOLDER = "?";
private final String prefix;
/**
* @param dao
* @param prefix
*/
Query(DAO dao, String prefix) {
super(dao);
this.prefix = prefix;
}
/* (non-Javadoc)
* @see com.github.napp.database.impl.Query#generate()
*/
@Override
protected final String getSQL() {
StringBuilder sb = new StringBuilder();
sb.append(prefix);
sb.append(dao.getTableName());
addToQuery(sb);
return sb.toString();
}
/**
* @param sb
*/
protected abstract void addToQuery(StringBuilder sb);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy