Сам ключ:
Код: Выделить всё
@Data
@Embeddable
public class FavoriteListingId implements Serializable {
@Column(name = "user_id", columnDefinition = "CHAR(36)")
private String userId;
@Column(name = "listing_id", columnDefinition = "CHAR(11)")
private String listingId;
}
Код: Выделить всё
@Getter
@Setter
@Entity
@Table(name = "favorite_listing")
public class FavoriteListingEntity {
@EmbeddedId
FavoriteListingId id;
}
Код: Выделить всё
@Repository
public interface FavoriteListingRepository extends JpaRepository {
int countByListingId(String listingId);
List findAllByUserId(String userId);
}
Для типа FavoriteListingEntity не найден идентификатор свойства userId!
Что я здесь делаю не так?
Подробнее здесь: https://stackoverflow.com/questions/790 ... -hibernate
Мобильная версия