【问题标题】:Grails GORM questionGrails GORM 问题
【发布时间】:2010-10-02 13:14:32
【问题描述】:

我有两个域类:

class A {
 String Name
 ...
}

class B {
 A request
 B response
 ...
}

如何获取在 B 中作为“请求”出现的唯一 As 列表?我试过了

def g = A.findAll("from A as e, B as r where e=r.request")

但我在提取结果对象时遇到问题。

谢谢

【问题讨论】:

    标签: grails grails-orm


    【解决方案1】:
    B.executeQuery( "select distinct b.request from B b" );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-13
      • 1970-01-01
      相关资源
      最近更新 更多