Spring – Generate Entity Classes

https://stackoverflow.com/questions/52943174/spring-tool-suit-generate-jpa-entity-from-database-solution

G9 plugin from Marketplace in Spring Tool Suit or Eclipse did job done.

Install Plugin G9
Select Project (JAVA)
Import “Import Database Model”
Select JDBC Driver (In my case mysql)
Maintain JDBC Connection
New
Provide Driver Name, Add Jar, Port, Driver Class and connection url along with schema (jdbc:mysql://localhost:3306/{schema_name})
Close JDBC Connection Box
Port, DB Name, User Name and PWD
Fetch
Reference URL https://www.esito.no/produkter/dbimport/

Swagger Vs OpenAPI

https://springdoc.org/

https://swagger.io/

springdoc-openapi is working better now.
There are issues with Swagger and Data Rest.

Spring Boot

Samples Code
https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples

Spring Boot with JSP
https://www.mkyong.com/spring-boot/spring-boot-hello-world-example-jsp/

Spring Session with Spring Boot
https://docs.spring.io/spring-session/docs/current/reference/html5/guides/boot.html

Spring Boot – Pagination with Data
http://docs.spring.io/spring-data/data-mongo/docs/current/reference/html/

Add Swagger to check all end points quickly.
http://heidloff.net/article/usage-of-swagger-2-0-in-spring-boot-applications-to-document-apis/

Secure end points
https://stackoverflow.com/questions/24049784/permit-post-on-a-rest-endpoint-springboot

Spring Actuators

Spring Boot Actuator

Spring Boot Logging
https://springframework.guru/using-logback-spring-boot/

Spring Boot Reference:
https://docs.spring.io/spring-boot/docs/current/reference/html/index.html
——————————————

Spring Security with React
http://juhahinkula.github.io/2016-12-05-reactsecurity/
https://github.com/juhahinkula/SpringReactWebpack

——————————————
Java MongoDB Example:
https://www.mongodb.com/blog/post/getting-started-with-mongodb-and-java-part-i

Sample MongoDB Data Files
https://github.com/ozlerhakan/mongodb-json-files

MongoDB Pagination
https://scalegrid.io/blog/fast-paging-with-mongodb/

//Page 1
db.users.find().limit (10)
//Page 2
db.users.find().skip(10).limit(10)
//Page 3
db.users.find().skip(20).limit(10)
……..
You get the idea. In general to retrieve page n the code looks like this

1
db.users.find().skip(pagesize*(n-1)).limit(pagesize)

——-
https://atom.io/
Markdown Editor.

Spring Boot Actuator

2. What Is An Actuator?

Actuators enable production-ready features to a Spring Boot application – without having to actually implement these things yourself.

They’re mainly used to expose different types of information about the running application – health, metrics, info, dump, env etc. And while these are no replacement for a production-grade monitoring solution – they’re a very good starting point.

Reference:

Spring Boot Actuator


http://docs.spring.io/spring-boot/docs/current/reference/html/index.html
http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html

Few URLs to test quickly
http://localhost:8080/beans
http://localhost:8080/configprops
http://localhost:8080/env
http://localhost:8080/health
http://localhost:8080/metrics
http://localhost:8080/mappings
http://localhost:8080/shutdown
Allows the application to be gracefully shutdown (not enabled by default).