10
私は以下のようなインタフェースを作成でき、Spring Dataは自動的に必要なデータベースアクセスを生成することを知っています。今私がしたいのは、一連の基準に一致するエンティティの数を数える新しいメソッド名を追加することです。「Count By」メソッド名の書き込み方法Springデータのクエリ
public interface EventRegistrationRepository extends JpaRepository<EventRegistration, String>
{
List<EventRegistration> findByUser_EmailAddress(String email);
int countByEvent_Code(String eventCode);
}
countByメソッドは、このエラーの原因となる今のところ:
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property count found for type com.brazencareerist.brazenconnect.model.relational.EventRegistration
私はここで何をしようとしているの正しい構文は何ですか?
まさに私たちが必要なもの! –
素晴らしい、ありがとうオリバー。春のデータが揺れる! – HappyCoder86
こんにちは!リンクが死んでいる –