public SqlStatementCustomizer createForMethod(Annotation annotation, Class sqlObjectType, Method method) {
Class<?> beanType = Resolver.findBeanType(sqlObjectType, method);
try {
final StatementRewriter rw = new AutoSelectByPKWriter(beanType);
return new SqlStatementCustomizer() {
public void apply(SQLStatement q) {
q.setStatementRewriter(rw);
}
};