Skip to content
Advertisement

Tag: spring-data-jpa

Implement Search specification for pagination

I implemented this Page request: The question is how to implement search functionality for this Page request? I would like to send params like type and dateAdded into GET params and return filtered result? Answer There are two ways to achieve this: Examples. Simple but can only be used for simple searches To be able to search by example, you

Error accessing field by reflection for persistent property [model.Credentials#email] on @EmbeddedID

I’ve been experiencing problems implementing the Authorities on my spring boot application, and after digging a little I realised that maybe the association between my Credentials and Authorities tables, was wrong. In fact it come to my attention that Spring allowed every type of user, (regardless their authority) to access ever method, even the ones I though have been secured.

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 in this table? Answer Like @kolossus mentioned: Use the @MapKeyJoinColumn¹ annotation, so that the classes (or

Spring Data JPA – Get all elements

I’m new to Spring Data JPA and I want to ask if there is a method that can be used to fetch all items, not by a certain criterion. Any help would be helpful. Answer Use the findAll method from repository Take a look here Spring Data JPA API Look here a small example that will fetch all MyObj objects

Unable to Run my Spring Security MVC WebApp SpringChainFilter throwing exception, rawPassword cannot be null

So I was trying to make a simple spring security hardcoded security just to check how my app is working before connecting it to the DB but before that it start showing me error 500. Here is my Configuration file Here is my webSecurity Configuration class with In memory authentication with some sample data. Here is my Servlet Initializer Class

Advertisement