Skip to content
Advertisement

Tag: entity

Why is Spring telling me the controller is an unknown entity upon saving a user?

After a few hours of running against the wall with this code, I’ve just about had it. This error is as indescriptive as can be. My User entity: https://pastebin.com/fqRJmMCc TicketController controller with just the function that holds user info: https://pastebin.com/n7jeciAM User service and repository essentials: https://pastebin.com/acYUF7sN Long story short is that the User object should only need a mail address,

Strange exception when mapping two columns in a table to the same column in another table

There are two entities: and when i create repository with custom query the exception is thrown but if i remove the second referencing column from the query the program starts without exceptions. Moreover, if i use standart query method bookRepository.findAll(): all works fine Books: Book{id=3, name=’Test book’, author=Person{id=1, name=’Person A’}, reviewer=Person{id=2, name=’Person B’}} Book{id=4, name=’Test book’, author=Person{id=2, name=’Person B’}, reviewer=Person{id=1,

JPA Hibernate Annotation Issue

I have three Entities i’m modeling and am having issues with the associated annotations. I basically have a class that I intend on returning to the caller, a nested listed of Project’s and the Project can contain a nested list of Endpoint’s. It’s a top-level has-a one-to-many, then the nested one-to-many has two one-to-many’s. I’ve played with @JoinColumn annotations, i’ve

Should Enterprise Java entities be dumb?

In our legacy Java EE application, there are loads of value object (VO) classes which typically contain only getters and setters, maybe equals() and hashCode(). These are (typically) the entities to be saved in persistence storage. (For the record, our app has no EJBs – although that might change in the future -, and we use Hibernate for persisting our

Advertisement