道类
@Query("select pt from com.ctpm.rrh.basket.model.user.User as u inner join u.userPaymentTransaction as pt where u = ?")
List<UserPaymentTransaction> findPaymentTransactionforUser(User user);
控制台上的查询异常
` org.hibernate.QueryException: 无法解析属性: userPaymentTransaction of: com.ctpm.rrh.basket.model.user.User [从 com.ctpm.rrh.basket.model.user.User 中选择 pt 作为你的内部加入你.userPaymentTransaction as pt where u = ?]
UserPaymentTransaction 类有
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private Money amount;
private String description;
@NotNull
@OneToOne(cascade = CascadeType.MERGE)
User owningUser;
private Date transactionDate;
请帮忙