Hello I have custom entity which has fields like name, description, date ant others, I created EventRepository and EventServiceImpl. Also i have a model RegisterEvent. Event entity: EventRepository: EventServiceImpl: RegisterEvent Model But when i Try to register event in my Html : I get the following error: And in the browser shows: I don’t know whats happening in the error
Tag: spring-data-jpa
Storing UUID as string in mysql using JPA
I came across a blog of using UUID with Hibernate and MySql. Now the problem is, whenever I take a look at the database the ID’s will be non-readable format (binary-16). How can I store UUID as a readable format like 7feb24af-fc38-44de-bc38-04defc3804fe instead of ¡7ôáßEN¹º}ÅÑs I was using this code And the result is ¡7ôáßEN¹º}ÅÑs. But I want it as
Page vs Slice when to use which?
I’ve read in Spring Jpa Data documentation about two different types of objects when you ‘page’ your dynamic queries made out of repositories. Page and Slice So, I’ve tried to find some articles or anything talking about main difference and different usages of both, how performance changes and how sorting affercts both type of queries. Does anyone has this type
Spring Data JPA – bidirectional relation with infinite recursion
First, here are my entities. Player : Team : As many topics already stated, you can avoid the StackOverflowExeption in your WebService in many ways with Jackson. That’s cool and all but JPA still constructs an entity with infinite recursion to another entity before the serialization. This is just ugly ans the request takes much longer. Check this screenshot :
How to use part of composite key in JPA repository methods?
I have a class with embedded Id Now in my repository I want to have a method to search only by secAccount, so how should I write findBy.. I tried findByAccountLinkKeySecAccount(String secAccount) but still no success. Answer I have rewritten your class and could add repository function as well. Here’s my implementation which you might consider taking a look at.
Use Spring Data JPA without Spring Boot application
I wanted to know if it is possible to use the Spring Data JPA without the rest of the spring framework? I used Spring Data JPA in a Spring Boot web application for another project and really liked how easy it was to use. Now I have a little project with some friends for a Desktop application without a server
Spring Security: Simple Encryption / decryption not working: InvalidKeyException
I’m trying to write a very simple program to encrypt and decrypt a string: But for some reason I never get an encrypted value. When I call enryptor.encrypt() it never reaches that point. I’m getting the following exception: What am I doing wrong? Answer Ok, after hours of searching I finally found the solution: Appearently I didn’t have the correct
How to setup multiple connection pools when multiple datasources are used in Spring Boot?
I have a Spring Boot application that connects to two separate databases. All works fine (I followed the steps in the docs and a tutorial), although in order to customize the Tomcat JDBC connection pool settings, I had to manually configure it (because by defining multiple data sources, the Boot auto-configuration is ignored, and Spring Boot does not read the
Query-by-example skip primitives?
Spring supports creating queries by examples of the object to look for. Like: Problem: if the @Entity has primitive fields, then their default value will actually be used for creating the query. The example above will result in: SELECT * from persons where lastname := ‘Smith’ and age := 0 In my example I have a database field where age
Difference between spring-data-jpa and spring-boot-starter-data-jpa
This may not be the best question to ask, but I noticed there are 2 Spring JPA for Spring boot. How are they different? Currently, I am trying to set up a Spring Boot 1.5.3 project along with Hibernate. I remember I had set up Spring Boot with JPA earlier with spring-boot-starter-data-jpa. Most of the online examples I have seen