nutz架构做的接口,如何优化接口查询速度?(请给点意见)
8 回复
@Override
public Tbl_union_weixin findUserByUnionId(String unionid) {
return dao().fetch(Tbl_union_weixin.class, Cnd.where(Tbl_union_weixin._unionid, "=", unionid));
}
例如这种查询如何优化,映入索引么?
@Table("tbl_union_weixin")
@TableIndexes({@Index(name="unionid",fields={"unionid"},unique=true)}
)
public class Tbl_union_weixin extends BeanBase{
private static final long serialVersionUID = 269247176;
public final static Map <String,Class<?>> types=new HashMap<String,Class<?>>();
public final static String _idtbl_union_weixin="idtbl_union_weixin";
public final static String _unionid="unionid";
public final static String _nickname="nickname";
public final static String _sex="sex";
public final static String _city="city";
public final static String _country="country";
public final static String _province="province";
public final static String _language="language";
public final static String _headimgurl="headimgurl";
public final static String _mobile="mobile";
public final static String _create_time="create_time";
public final static String[] keys={"idtbl_union_weixin"};
添加回复
请先登陆