以更新为例子:
@UpdateProvider注解的使用 : @UpdateProvider(type = 类名,method = 应用到的方法)
@UpdateProvider(type = VideoProvider.class,method = "updateVideo")
int update(Video video);
public class VideoProvider {
public String updateVideo(final Video video){
return new SQL(){{
UPDATE("video");
if (video.getDetail()!=null){
SET("detail=#{detail}");
}
if (video.getTitle()!=null){
SET("title=#{title}");
}
WHERE("id=#{id}");
}}.toString();
}
}