Posts

Showing posts with the label JPA

Spring Boot + FreeMarker + Spring Data JPA - CRUD example

Image
Hello everyone, Today we will learn how to develop a Spring Boot CRUD web application, using Spring Boot, FreeMarker template, H2DB, and JPA. Apache FreeMarker is a template engine: a Java library to generate text output (HTML web pages, e-mails, configuration files, source code, etc.) based on templates and changing data. Templates are written in the FreeMarker Template Language (FTL), which is a simple, specialized language. Usually, a general-purpose programming language (like Java) is used to prepare the data (issue database queries, do business calculations). Then, Apache FreeMarker displays that prepared data using templates. In the template, you are focusing on how to present the data, and outside the template, you are focusing on what data to present.  More Info -  https://freemarker.apache.org/ The technology stack used: Spring Boot 2.5.5 Spring MVC 5.3.10 Maven 3 JDK 11 FreeMarker 2.3.31 H2DB  Bootstrap Project Structure Dependency Management-Maven-Pom.xml Puts spring-boot-st

Spring Boot + Apache Commons Export Data to CSV Example

Image
Hello everyone, today we will learn how to export and download the data as a CSV file in a Spring Boot project. CSV stands for Comma-Separated-Values and it's a common format for doing a bulk data transfer between systems. For creating and parsing CSV files, we will use Apache Commons' 3rd-party library.  Technologies used   Spring Boot Apache Commons Spring Data JPA H2DB Maven Project directory Maven[pom.xml]   A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details utilized by Maven to build the project. <?xml version = "1.0" encoding = "UTF-8" ?> <project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelVersion> 4.0.0 </model