代码之家  ›  专栏  ›  技术社区  ›  xain

格雷尔斯·戈姆问题

  •  2
  • xain  · 技术社区  · 14 年前

    我有两个域类:

    class A {
     String Name
     ...
    }
    
    class B {
     A request
     B response
     ...
    }
    

    我怎样才能得到一个唯一的列表,作为“请求”出现在B中?我试过

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

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

    谢谢

    1 回复  |  直到 14 年前
        1
  •  4
  •   Aaron Saunders    14 年前
    B.executeQuery( "select distinct b.request from B b" );
    
    推荐文章