Skip to content

Tag: spring-boot

How to read database view metadata

I’m trying to use Java and Spring to read the table structure for a MySQL database. The code I’ve got (based on other answers on this site) is: If I call this code with the name of any of my database tables, it works perfectly. However, when I pass the name of any of my database views, I get the

set class fields based on enum value

Using the above code I can get the value of Tempclass fields based on enum values. Now how to set the fields of Tempclass based on enum value ex: if enum VALUE2 is selected, then i need to set the Tempclass field2 to the input value. Answer Use a BiConsumer<Tempclass, String> taking an instance of TempC…

Database error with Java Spring boot Project

I am trying to run a Java Spring Boot survey project (Maven Architecture) in my local machine by following steps — mvn clean package connect to created jar file java -jar target/filename.jar Open browser and browse to localhost:8080 Project is running ok, I can input survey data, but I am getting follow…

Java JPA SpringBoot

I have table A and table B, table B have a fk that rererences to table A. class EntityA class EntityB But when i try to call findAll method from repository (from EntityA) i get: Could not write JSON: Infinite recursion Answer I’ve solved the problem using unidirectional relationship. Used this on my Ent…

Define Spring dependency matching a Spring Boot version

I am developing two projects. Project 1 is a spring-boot application based on gradle for dependency management. This application defines extension-points. If – at runtime – an extension is found on the classpath, this extension is being called from the main application under certain circumstances.…