
com.venky.swf.sql.Delete Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swf-db Show documentation
Show all versions of swf-db Show documentation
Succinct Web Framework - Db
The newest version!
package com.venky.swf.sql;
import com.venky.swf.db.model.Model;
import com.venky.swf.db.model.reflection.ModelReflector;
public class Delete extends DataManupulationStatement {
private String table ;
public Delete(ModelReflector ref){
this(ref.getPool(),ref.getTableName());
}
public Delete(String pool,String table){
super(pool);
this.table = table;
}
@Override
public void finalizeParameterizedSQL() {
StringBuilder builder = getQuery();
builder.append("DELETE FROM ").append(table);
Expression where = getWhereExpression();
if (where != null){
builder.append(" WHERE ");
builder.append(where.getParameterizedSQL());
getValues().addAll(where.getValues());
}
}
private Expression whereExpression ;
public Delete where(Expression expression){
this.whereExpression = expression;
return this;
}
public Expression getWhereExpression(){
return whereExpression;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy