加载中…
  
博文
标签:

佛学

分类: 编程
转自: http://golanghome.com/post/251

Filter方法和Exclude方法内部都是使用SetCond方法来连接查询字符串的。当然这里我们也可以直接使用SetCond来自己连接查询字符串,然后使用同样的方法去查询数据。Filter方法和Exclude方法原型如下。

Filter(string, ...interface{}) QuerySeter
Exclude(string, ...interface{}) QuerySeter
而在beego框架中,这两个方法的实现如下:

// add condition expression_r to QuerySeter.
func (o querySet) Filter(expr string, args ...interface{}) QuerySeter {
    if o.cond == nil {
        o.cond = NewCondition()
    }
    o.cond = o.cond.And(expr, args...)
    return &o
}

// add NOT condition to querySeter.
func (o querySet) Exclude(expr string, args ...interface{}) QuerySeter {
&nbs
(2013-04-10 16:27)
标签:

it

分类: 网络

568A

标签:

it

分类: 数据库

  历史上最年轻的图灵奖获得者

 

  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有