Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
环境:grails 2.0.1
我有一个简单的域实体:
class Author { String name static hasMany = [books : Book]
}
我正在尝试加载 id 1 的代理
def auth = Author.load(1)
但是,正如我从控制台 sql 日志中看到的那样,执行了一个查询来获取 Author 的非代理实例!为什么它会这样工作?以及如何加载代理实例?
怎么样
def author = Author.get(1)
或只读实例:
def author = Aughor.read(1)