CRUD task management system based on Spring-boot 2.x + Quartz, suitable for small and medium projects.
CRUD task management system based on Spring-Boot + Quartz:
Gitee.com/52itstyle/s…
The development environment
JDK1.8, Maven, Eclipse
Technology stack
SpringBoot2.0.1, thymeleaf3.0.9, quartz2.3.0, iview, vue, layer, AdminLTE, bootstrap
Start the show
- The database used by the project is MySql. Select tables_mysql_innodb. SQL in Resources/SQL to initialize database information.
- In resources/application. The replacement for your data source in the properties files.
- Run the Application the main method to start the project, the project can automatically create a test task See: com. Itstyle. Quartz. Config. TaskRunner. Java.
- Project access address: http://localhost:8080/task
Project screenshots
Version differences (spring-boot 1.x and 2.x)
This is just a comparison of the two projects, but there are a few things to note about spring-Boot 2.x.
Project Name Configuration:
# spring boot 1.x
server.context-path=/quartz
# spring boot 2.x
server.servlet.context-path=/quartzCopy the code
Thymeleaf configuration:
#spring boot 1.x
spring.thymeleaf.mode=LEGACYHTML5
#spring boot 2.x
spring.thymeleaf.mode=HTMLCopy the code
Hibernate configuration:
Hibernate 4 naming strategy fully qualified name. Not supported with Hibernate 5. spring.jpa.hibernate.naming.strategy = org.hibernate.cfg.ImprovedNamingStrategy # stripped before adding them to the entity manager) spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect # Hibernate 5 spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImplCopy the code
Quartz configuration:
# Spring Boot 2.x Without the configure spring. Quartz. Job - store - type = JDBC spring.quartz.properties.org.quartz.scheduler.instanceName=clusteredScheduler spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_ spring.quartz.properties.org.quartz.jobStore.isClustered=true spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval=10000 spring.quartz.properties.org.quartz.jobStore.useProperties=false spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool spring.quartz.properties.org.quartz.threadPool.threadCount=10 spring.quartz.properties.org.quartz.threadPool.threadPriority=5 spring.quartz.properties.org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=trueCopy the code
Default home page configuration:
*/ @configuration Public Class MyAdapter extends WebMvcConfigurerAdapter{ @Override public void addViewControllers( ViewControllerRegistry registry ) { registry.addViewController( "/" ).setViewName( "forward:/login.shtml" ); registry.setOrder( Ordered.HIGHEST_PRECEDENCE ); super.addViewControllers( registry ); }}Copy the code
/** * The WebMvcConfigurerAdapter was deprecated in SpringBoot2.0 and Spring 5.0 */ @configuration public class MyAdapter implements WebMvcConfigurer{@override public void addViewControllers( ViewControllerRegistry registry ) { registry.addViewController( "/" ).setViewName( "forward:/login.shtml" ); registry.setOrder( Ordered.HIGHEST_PRECEDENCE ); }}Copy the code
Problems to be solved:
/**
* Set a strategy for handling the query results. This can be used to change
* "shape" of the query result.
*
* @param transformer The transformer to apply
*
* @return this (for method chaining)
*
* @deprecated (since 5.2)
* @todo develop a new approach to result transformers
*/
@Deprecated
Query<R> setResultTransformer(ResultTransformer transformer);Copy the code
Hibernate 5.2 has scrapped setResultTransformer to develop a new method of fetching collections, which is obviously not yet implemented and in TODO state.
Project source: gitee.com/52itstyle/s…
Author: Xiao Qi 2012
Welcome to blog.52itstyle.com