【问题标题】:Column Computation in Grails Search CriteriaGrails 搜索条件中的列计算
【发布时间】:2014-02-19 10:19:23
【问题描述】:

我想知道如何使用 grails 标准执行列计算。基本上将转换为以下 sql 查询的条件语法。

SELECT * FROM table WHERE (first_column * second_column) > 30;

【问题讨论】:

    标签: grails grails-orm


    【解决方案1】:

    一种可能的选择是使用sql restrictions

    def results = DomainClass.withCriteria {
      ...
      sqlRestriction "(first_column * second_column) > 30"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-11
      • 2019-12-25
      • 1970-01-01
      • 1970-01-01
      • 2012-03-11
      • 1970-01-01
      • 1970-01-01
      • 2014-10-27
      相关资源
      最近更新 更多