現在のユーザーから特定のレンタルリストを取得しようとしています。コントローラでgrails - org.hibernate.QueryException(プロパティを解決できませんでした)
コード:
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
は私が間違って何をしているのですか?
レンタルドメインクラスを確認できますか? –