Skip to content

Tag: jpa

JPA With composite key non standard

I’m trying to do a JPA mapping for an existing database. I can’t really change the existing structure. I managed to make it works, but Intellij is telling me that some column doesn’t exist even if it works. So I don’t know if there’s a better way to do this or if it’s Intel…

How to annotate Map with JPA?

The app’s stack: Spring MVC, Spring DataJPA, Hibernate. There are three entities: student, tutor, theme. Theme: Student: Tutor: For save student-tutor-theme relationships i want use this table (PostgreSQL): How i can to annotate tutors and students fields in entities, for their content correct persists …

How to cascade delete set of enums in JPA?

I have the roles field in User entity: when I try to delete user with a query, the referential integrity constraint violation occurs, because user is referenced from User_roles table. How to solve this in any way? DDL for related table shows i.e. it doesn’t contain ON DELETE CASCADE clause. I need it be…