net.turnbig.qb.segment.impl.single.RightLikeSegment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of query-builder Show documentation
Show all versions of query-builder Show documentation
Criterion for jdbc, but not only Criterion
The newest version!
package net.turnbig.qb.segment.impl.single;
import net.turnbig.qb.segment.Settings;
/**
* @author wuqb
* @date 2010-9-10
* @version $Revision$
*/
public class RightLikeSegment extends SingleSqlSegment {
/**
* @param fieldName
* @param paramValue
*/
public RightLikeSegment(String fieldName, Object paramValue, Settings settings) {
super(fieldName, paramValue + "%", settings);
}
/*
* (non-Javadoc)
*
* @see edu.woo.qb.segment.QueryCondition#getCondition()
*/
@Override
public String asSql() {
StringBuilder builder = new StringBuilder();
builder.append(this.fieldName).append(" like ':").append(this.getParamKey()).append("%'");
return builder.toString();
}
/*
* (non-Javadoc)
*
* @see edu.woo.qb.segment.SqlSegment#isNeedNamedParam(boolean)
*/
@Override
public boolean isParamRequired() {
return true;
}
}