SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Dave Tolls wrote:What errors are you getting?
(Note that the RouteId is supposed to have getters and setters)
Dave Tolls wrote:For the first one, I think this was mentioned earlier.
The class cannot be final as JPA/Hibernate needs to be able to extend the class as part of how it handles persistence.
The next says exactly what the issue is (again, I think this was brought up earlier). You need valid equals and hashcode methods.
The following three imply that the primary keys for those classes are not Long, which is what you are using in the RouteId class.
The fields have to match.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Dave Tolls wrote:Airline and Airport use ints for their ids.
Your RouteId class uses Long.
That's why JPA is complaining about:
The type of the ID mapped by the relationship 'source' does not agree with the primary key class of the target entity.
Stephan van Hulst wrote:Why not:
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
An IDE is no substitute for an Intelligent Developer.
Stephan van Hulst wrote:I doubt the temporary addition of 50-100 bytes on the stack is that much of a big deal either.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
|