1.为了使用
2.在写语句时很容易引入很难察觉的错误 比如“ : ” ,和“ : ” .这两个字符在.java 文件里面会区别非常明显,但是在xml中,肉眼是看不出来的。所以尽量统一,将标点用半角英文。
3.所有出现字段的地方,尽可能精确的制定类型,虽然有些地方看起来写或者不写都可以正常运行,这样做可以减少出错的几率,减少后顾之忧。
4.贴出一段做范例。
TOMap:
[html]
SQL:
[html]
update USER
where ID=#id: INTEGER#
TO:
[html]
public class UserTO implements Constant {
private Integer id;
private String username;
private String password;
private Integer gender;
private Integer imageId;
private Date dateOfBirth;
private Date createdDate;
如果可以,可以做两套TO,一个作为参数,另一个TO作为返回值。这里就不举例了。