以下のように、service.xml でサービス エンティティを定義しています。
<entity name="LoginData" local-service="true" remote-service="false">
<!-- PK fields -->
<column name="userId" type="long" primary="true" />
<column name="loginDate" type="Date" primary="true" />
</entity>
LocalServiceImpl クラスで定義されているように、dynamicQuery を使用して行をフェッチしようとしています。
DynamicQuery dynamicQuery=DynamicQueryFactoryUtil.forClass(LoginData.class);
dynamicQuery.add(RestrictionsFactoryUtil.eq("userId", userId));
dynamicQuery.add(RestrictionsFactoryUtil.between("loginDate", startDate, endDate));
return (List<LoginData>)LoginDataLocalServiceUtil.dynamicQuery(dynamicQuery);
しかし、上記のコードの最後の行は次のように例外をスローします
Caused by: org.hibernate.QueryException: could not resolve property: userId of: com.example.model.impl.LoginDataImpl
誰かがここで何が悪いのか教えてもらえますか? または、何か不足していますか?