Skip to content

wgpshashank/spring-data

 
 

Repository files navigation

NixMash Spring

This project demonstrates Spring Data JPA, Spring Data Solr, Spring Web MVC, Spring Security and Thymeleaf. It accompanies blog posts at http://nixmash.com which are listed below in their accompanying implementation version. See the Installation section below on how to quickly configure application settings to run NixMash Spring.

A working demo of the site is online at http://nixmashspring.daveburkevt.com.

##Implemented##

Implementations listed in the Release History below are found in their corresponding branch, v0.0.1, v0.0.2, etc. Newer branches may not contain features found in prior versions.

##Release History##

##v0.2.7 -- Solr MVC##

Solr Search in v0.2.7

[back to top]

##v0.2.6 -- Solr Query Samplings##

Solr Facet Query in v0.2.6

[back to top]

##v0.2.5 -- Spring Boot 1.3##

  • Spring-Boot-1.3.0.RELEASE

[back to top]

##v0.2.4 -- Multiple Solr Repository Configurations##

Four Solr Repository Options in v0.2.4

[back to top]

##v0.2.3 -- Initial Solr Release##

Simple Solr Query results in v0.2.3

[back to top]

##v0.2.2 -- Eclipse-Friendly NixMash Spring##

NixMash Spring in Eclipse Project Explorer for v0.2.2

[back to top]

##v0.2.1 -- Spring MVC and JavaScript Samplings##

Bootstrap Multiselect Plugin in v0.2.1

[back to top]

##v0.2.0 -- Spring Data JPA Auditing##

MySQL JPA Audit Data in v0.2.0

[back to top]

##v0.1.9 -- More Child Object Handling in MVC and Thymeleaf##

Radio Button Child Hobby Objects in v0.1.9

[back to top]

##v0.1.8 -- Child Object Processing (Phones), MVC Method Level Security##

Contact Phone Children in v0.1.8

[back to top]

##v0.1.7 -- Full MySQL Support, WAR Deployment##

[back to top]

##v0.1.6 -- Initial Release w/ Spring Security##

Registration form validation in v0.1.6

[back to top]

##v0.1.5 -- Contact Add/Update Form, Dandelion Asset Bundling##

Using jQuery-UI with Dandelion in v0.1.5

[back to top]

##v0.1.4 -- Contact Display, List and Search##

Bootstrap with All Contacts Display in Spring-Data MVC with Thymeleaf v0.1.4

[back to top]

##v0.1.3 -- Initial release w/ Thymeleaf##

Spring-Data MVC with Thymeleaf in v0.1.3

[back to top]

##v0.1.2 -- Multi-Module with JPA and MVC Modules##

Spring-Data Does MVC in v0.1.2

[back to top]

##v0.1.1 -- @ManyToMany Hobbies added to Contact Model##

  • Addition of Hobbies, a @ManyToMany Entity with Contacts
  • Adding Hobbies dynamically on new and updated Contacts, and as separate process
  • Adding and removing Hobbies from Contact
  • ContactDTO with Set
  • Tests covering above Hobby processes
  • Post: Working with the Many in a JPA @ManyToMany

[back to top]

##v0.1.0 -- @OneToMany Contact Phones added to Contact Model##

[back to top]

##v0.0.9 -- Lazy Loading examples##

  • Several examples of Lazy Loading
  • First pass at creating schema DTO objects for use in updating and creating data
  • Modified database schema to better adhere to database relationship best practices. Updates are reflected in Entities.
  • Post: Approaches to JPA Lazy Loading

[back to top]

##v0.0.8 -- Multi-database configuration w/ H2Console and MySQL##

[back to top]

##v0.0.7 -- Multi-profile configuration##

[back to top]

##v0.0.6 -- GUI Generated Entities and Diagram Examples##

Image of Spring Data JPA Output v0.0.6

[back to top]

##v0.0.5 -- Hibernate and JPA Module structure##

[back to top]

##v0.0.4 -- Initial Release with JPA##

  • Spring Data JPA Implementation
  • Dual SpringJPAConfiguration and SpringHbnConfiguration classes
  • Simultaneous use of both Spring Data JPA and Hibernate with Transaction Isolation
  • Updated MySQL Schema with additional data
  • Shared Model Entities between Hibernate and Spring Data JPA
  • Spring 4.0.6, Spring-Boot 1.1.4
  • Post: JPA Added to Spring Data GitHub App v0.0.4

Image of Spring Data JPA Output v0.0.4

[back to top]

##v0.0.3 -- DAO Implementation##

[back to top]

##v0.0.2 -- Using Spring Properties##

  • Populating DataSource connection from Property File
  • Using both @Value and @Autowired Environment properties
  • Annotations with @ImportResource of app-context.xml file
  • Custom SpringPropertiesUtil Class to retrieve overriden "username" System Property
  • Populating @Autowired PropertyClass class properties in @Configuration class and retrieving the properties in another class
  • Spring 4.0.6, Spring-Boot 1.1.4
  • Post: A Spring Property Handling Exercise
  • Post: Spring-Data Demo App v0.0.2 on GitHub

Image of Output v0.0.2

[back to top]

##v0.0.1 -- Base Configuration in Spring and Hibernate##

  • Changed XML Spring Configuration to Annotations
  • Changed datasource from embedded H2 to MySql
  • Lazy Fetching
  • Named Queries
  • Logging Configuration
  • Gradle Build Configuration
  • Inserting data
  • Note: v0.0.1 was created with Spring Boot v1.1.4. Using v1.2.x generates a compile error regarding JPA Entity handling.
  • Post: New Spring-Data Demo on GitHub

Image of Output v0.0.1

##Installation##

The application supports an H2 Profile (default) and a MySQL Profile. To run JPA Console app use $gradle jpa:bootRun. To run MVC Web app use $gradle mvc:bootRun. The Tomcat Server Port is set for 8084 (set in the MVC application.properties file) so go to http://localhost:8084 to view the app in your browser.

##Installation - Database Configuration##

To use MySQL run setup.mysql script in the /install directory to populate the database. Update Datasource connection properties in /resources/META-INF/spring/mysql.properties file. The H2 create-data script for the tests is located in /resources/db. External properties in /home/daveburke/...external.properties. Change in JPA common/ApplicationSettings. Example of external.properties in /install.

##Installation - External Property File Settings##

The JPA Project demonstrates using an external Property File. To Configure Location of Properties File, change the @PropertySource annotation setting in Jpa/ApplicationSettings.class.

@Component
@PropertySource("file:/home/daveburke/web/nixmashspring/external.properties")
@ConfigurationProperties(prefix="external")
public class ApplicationSettings {

##Installation - Solr##

Configure Solr as normally on your development machine. Documents are included in /dev/solr/docs and scripts to populate the Solr Url and Embedded Servers located in /dev/solr. Script name: refreshSolr.sh. It contains additional installation instructions.

The Solr Project demonstrates both Embedded Solr and Http Solr ("dev" and "prod" Profiles respectively.) Configure these in an external solr.properties file. Same configuration as external.properties file just discussed. Set solr.properties file location in Solr project common/SolrSettings.java @PropertySource value.

##References##

Version 0.0.1 of the app was based on Chapter #7 of Pro Spring, Fourth Edition from Apress, "Using Hibernate." (An excellent book, btw.) Here is the book's listing on Apress. For Safari users, here is the online version of it on Safari.

The Generic DAO structure in Version 0.0.3 was based on Chapter #2 of Spring in Practice by Willie Wheeler and Joshua White, "Data persistence, ORM, and transactions." Here is the Chapter on Safari.

Multiple database JPA Configuration implemented in Version 0.0.8 based largely on the work of Gordon Dickens' Spring-Data-Demos "Profiles" project.

Several components related to Thymeleaf and Security in Version 0.1.x from Arnaldo Piccnelli's Enhanced Pet Clinic.

Petri Kainulainen’s excellent book Spring Data from Packt Publishing and accompanying source code was a reference for Model Attribute handling and feedback messaging in Version 0.1.5 as well as other features.

Two excellent source references for Spring Security which initially appeared in Version 0.1.6 were Rob Winch's gs-spring-security-3.2 something and Bartosz Kielczewski's example-spring-boot-security.

Petri Kainulainen also served as a great reference on Solr in Version 0.2.3. See his excellent Spring Data Solr Tutorial(http://www.petrikainulainen.net/spring-data-solr-tutorial/) on his blog. Another good reference on Solr was Christoph Strobl's spring-data-solr-examples on GitHub.

Spring Framework contributor Christoph Strobl's Spring Data Solr Showcase(https://github.com/christophstrobl/spring-data-solr-showcase) served as the basis of Solr Autocomplete found in Version 0.2.7.

About

NixMash Spring : Spring JPA, MVC, Solr, Spring Security and Thymeleaf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 51.9%
  • JavaScript 29.7%
  • HTML 13.3%
  • CSS 4.7%
  • Shell 0.4%