Skip to content
Advertisement

Tag: hibernate-mapping

DuplicateMappingException contains physical column name referred to by multiple logical column names on adding passportId to the Student entity

This code is causing the following exception on the startup I’m using H2 in-memory database. Student entity: Passport entity: Question 1: What is the reason for org.hibernate.DuplicateMappingException? Question 2: Why does adding the following annotation to passportId in the Student entity resolve the issue? PS: I know similar questions has been asked earlier but I couldn’t understand the answer for

Hibernate: mapping with a map and getting argument type mismatch

I’ve got this class DepartmentPerson in Java where I’ve mapped a Map in Hibernate as following: and in the class I have acceptByPeriod defined as following: Whenever I run a query on DepartmentPerson, I get the message: “java.lang.IllegalArgumentException: argument type mismatch”. This has something to do with the acceptByPeriod mapping, as when I remove it the problem disappears. All 3

JPA SQL Result Mapping

my code is mapping query result to DTO using Sql Result Mapping and create list with these dtos but in my database id can be null and it gives me trouble in mapping. That’s why I don’t want to use it …

“Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements”

Good morning Stackoverflow, I have the problem that it gives me the error: Failed to create sessionFactory object.org.hibernate.AnnotationException: Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: nl.scalda.pasimo.model.employeemanagement.EducationTeam.coachGroups Do you know why? Answer The Exception is straightforward and says : Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements, so the cause

Advertisement