0

ダオクラス

@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);

コンソールの QueryException

` org.hibernate.QueryException: could not resolve property: userPaymentTransaction of: com.ctpm.rrh.basket.model.user.User [select pt from com.ctpm.rrh.basket.model.user.User as u inner join u .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;

助けてください

4

1 に答える 1

0

あなたのクエリは次のようになるはずです:-

@Query("select pt from UserPaymentTransaction pt where pt.owningUser = ?1")
于 2013-10-01T06:23:17.810 に答える