ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Cannot query a table with composite key in Hibernate

Автор: Emrah KAYA

Загружено: 2024-10-12

Просмотров: 0

Описание: Hello everyone! I hope this video has helped solve your questions and issues. This video is shared because a solution has been found for the question/problem. I create videos for questions that have solutions. If you have any other issues, feel free to reach out to me on Instagram:   / ky.emrah  

Below, you can find the text related to the question/problem. In the video, the question will be presented first, followed by the answers. If the video moves too fast, feel free to pause and review the answers. If you need more detailed information, you can find the necessary sources and links at the bottom of this description. I hope this video has been helpful, and even if it doesn't directly solve your problem, it will guide you to the source of the solution. I'd appreciate it if you like the video and subscribe to my channel!Cannot query a table with composite key in Hibernate

I have a table with userId and listingId. They together form a composite key.
The key itself:
@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;
}

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

The table:
@Getter
@Setter
@Entity
@Table(name = "favorite_listing")
public class FavoriteListingEntity {
@EmbeddedId
FavoriteListingId id;
}

@Getter
@Setter
@Entity
@Table(name = "favorite_listing")
public class FavoriteListingEntity {
@EmbeddedId
FavoriteListingId id;
}

The repository:
@Repository
public interface FavoriteListingRepository extends JpaRepository FavoriteListingEntity, FavoriteListingId {
int countByListingId(String listingId);

List FavoriteListingEntity findAllByUserId(String userId);
}

@Repository
public interface FavoriteListingRepository extends JpaRepository FavoriteListingEntity, FavoriteListingId {
int countByListingId(String listingId);

List FavoriteListingEntity findAllByUserId(String userId);
}

But findAllByUserId does not work. It gives me the following error:

No property userId found for type FavoriteListingEntity!

No property userId found for type FavoriteListingEntity!
What am I doing wrong here?


Tags: java,spring-boot,hibernate,jpaSource of the question:
https://stackoverflow.com/questions/7...

Question and source license information:
https://meta.stackexchange.com/help/l...
https://stackoverflow.com/

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Cannot query a table with composite key in Hibernate

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Что устраивает Москву?

Что устраивает Москву?

Перестаньте использовать длинные формулы: попробуйте вместо них «*» и «?»

Перестаньте использовать длинные формулы: попробуйте вместо них «*» и «?»

Vintage Floral Free Tv Art Wallpaper Screensaver Home Decor Samsung Oil Painting Digital Wildflower

Vintage Floral Free Tv Art Wallpaper Screensaver Home Decor Samsung Oil Painting Digital Wildflower

КАК НЕЛЬЗЯ ХРАНИТЬ ПАРОЛИ (и как нужно) за 11 минут

КАК НЕЛЬЗЯ ХРАНИТЬ ПАРОЛИ (и как нужно) за 11 минут

Убей скучный Excel: сделай ВЕБ-дашборд без кода с помощью ИИ (пошаговый гайд)

Убей скучный Excel: сделай ВЕБ-дашборд без кода с помощью ИИ (пошаговый гайд)

AGI Достигнут! ChatGPT 5.2 Рвет ВСЕ Тесты! Внезапно OpenAI Выкатил Новую ИИ! Новая Qwen от Alibaba.

AGI Достигнут! ChatGPT 5.2 Рвет ВСЕ Тесты! Внезапно OpenAI Выкатил Новую ИИ! Новая Qwen от Alibaba.

Роковая ошибка Jaguar: Как “повестка” в рекламе добила легенду британского автопрома

Роковая ошибка Jaguar: Как “повестка” в рекламе добила легенду британского автопрома

Christmas Magic: Happy Snowman Art Screensaver | 16 Stunning 4K Images for Your TV

Christmas Magic: Happy Snowman Art Screensaver | 16 Stunning 4K Images for Your TV

Музыка Моцарта для поднятия настроения и вдохновения

Музыка Моцарта для поднятия настроения и вдохновения

Понимание Active Directory и групповой политики

Понимание Active Directory и групповой политики

Как извлечь данные из другого листа на основе критериев

Как извлечь данные из другого листа на основе критериев

ВСЕ ЧИСЛА В ИСПАНСКОМ — ЛЕГКО ЗАПОМНИТЬ, ПОТОМУ ЧТО ЕСТЬ ЛОГИКА! #испанскийязык

ВСЕ ЧИСЛА В ИСПАНСКОМ — ЛЕГКО ЗАПОМНИТЬ, ПОТОМУ ЧТО ЕСТЬ ЛОГИКА! #испанскийязык

ТОП ошибок в Word и фишки, которые ты не используешь | Word mistakes you must fix

ТОП ошибок в Word и фишки, которые ты не используешь | Word mistakes you must fix

5 секретов Excel, о которых вы можете стыдиться, если не знали

5 секретов Excel, о которых вы можете стыдиться, если не знали

КЛАССИЧЕСКАЯ МУЗЫКА ДЛЯ ВОССТАНОВЛЕНИЯ НЕРВНОЙ СИСТЕМЫ🌿 Нежная музыка успокаивает нервную систему 22

КЛАССИЧЕСКАЯ МУЗЫКА ДЛЯ ВОССТАНОВЛЕНИЯ НЕРВНОЙ СИСТЕМЫ🌿 Нежная музыка успокаивает нервную систему 22

Что такое схема STAR | Схема «Звезда» или «Снежинка»? | Таблица фактов или таблиц измерений

Что такое схема STAR | Схема «Звезда» или «Снежинка»? | Таблица фактов или таблиц измерений

Happy Birthday 4K Screensaver/Live Wallpaper I Birthday Background I 1 Hour

Happy Birthday 4K Screensaver/Live Wallpaper I Birthday Background I 1 Hour

How to remove

How to remove "http://", "https://", or "www." from string in pandas [closed]

Фишки Excel, которые я использую КАЖДЫЙ ДЕНЬ! ЭТО нужно каждому

Фишки Excel, которые я использую КАЖДЫЙ ДЕНЬ! ЭТО нужно каждому

Vintage Floral Free Tv Art Wallpaper Screensaver Home Decor Samsung Oil Painting Digital Wildflower

Vintage Floral Free Tv Art Wallpaper Screensaver Home Decor Samsung Oil Painting Digital Wildflower

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]