【发布时间】:2017-09-30 21:57:45
【问题描述】:
我正在尝试从当前用户那里获取特定租赁的列表。
控制器中的代码:
def index() {
if (isLoggedIn()) {
String username = getPrincipal().username
def accountInstance = Account.findByUsername(username)
def rentalInstanceList = Rental.findAll("from Rental as r where r.account_id=:accountid", [accountid: accountInstance.id])
}
}
account_id 是外键。
运行后报错:
could not resolve property: account_id of: ers.Rental
我做错了什么?
【问题讨论】:
-
我们可以查看您的租赁域类吗?