Integration of springboot2.x Development Case Quartz Task management system

Source: Internet
Author: User
Tags deprecated

A CRUD task management system based on Spring-boot 2.x + quartz for small and medium-sized projects.

CRUD task management system based on Spring-boot +quartz:

Https://gitee.com/52itstyle/spring-boot-quartz

Development environment

JDK1.8, Maven, Eclipse

Technology stack

SpringBoot2.0.1, thymeleaf3.0.9, quartz2.3.0, iview, vue, layer, Adminlte, bootstrap

Startup instructions
    • The database used by the project is MySQL, select the Tables_mysql_innodb.sql file in Resources/sql to initialize the database information.
    • Replace it with your own data source in the Resources/application.properties file.
    • Run the application Main method to start the project, project startup will automatically create a test task see: Com.itstyle.quartz.config.TaskRunner.java.
    • Project Access address: Http://localhost:8080/task
Project

Project Source: Https://gitee.com/52itstyle/spring-boot-task

Version differences (Spring-boot 1.x and 2.x)

Here is a comparison of the similarities and differences between the two projects, of course, Spring-boot 2.x version of the upgrade there are many areas to be aware of.

Project name configuration:

# spring boot 1.xserver.context-path=/quartz# spring boot 2.xserver.servlet.context-path=/quartz

Thymeleaf configuration:

#spring boot 1.xspring.thymeleaf.mode=LEGACYHTML5#spring boot 2.xspring.thymeleaf.mode=HTML

Hibernate configuration:

# spring boot 2.x JPA 依赖  Hibernate 5# 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 5spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImplspring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

Quartz configuration:

 # Spring Boot 2.x integrates quartz without configuring it yourself spring.quartz.job-store-type= Jdbcspring.quartz.properties.org.quartz.scheduler.instancename= Clusteredschedulerspring.quartz.properties.org.quartz.scheduler.instanceid= autospring.quartz.properties.org.quartz.jobstore.class= org.quartz.impl.jdbcjobstore.jobstoretxspring.quartz.properties.org.quartz.jobstore.driverdelegateclass= Org.quartz.impl.jdbcjobstore.stdjdbcdelegatespring.quartz.properties.org.quartz.jobstore.tableprefix=qrtz_ Spring.quartz.properties.org.quartz.jobstore.isclustered= Truespring.quartz.properties.org.quartz.jobstore.clustercheckininterval= 10000spring.quartz.properties.org.quartz.jobstore.useproperties= falsespring.quartz.properties.org.quartz.threadpool.class= Org.quartz.simpl.simplethreadpoolspring.quartz.properties.org.quartz.threadpool.threadcount= 10spring.quartz.properties.org.quartz.threadpool.threadpriority= 5spring.quartz.properties.org.quartz.threadpool.threadsinheritcontextclassloaderofinitializingthread=true 

Default Home page configuration:

/** * 配置首页 spring boot 1.x * 创建者 小柒2012 * 创建时间 2017年9月7日 */@Configurationpublic class MyAdapter extends WebMvcConfigurerAdapter{    @Override    public void addViewControllers( ViewControllerRegistry registry ) {        registry.addViewController( "/" ).setViewName( "forward:/login.shtml" );        registry.setOrder( Ordered.HIGHEST_PRECEDENCE );        super.addViewControllers( registry );    } }
/** * 配置首页(在SpringBoot2.0及Spring 5.0 WebMvcConfigurerAdapter以被废弃  * 建议实现WebMvcConfigurer接口) * 创建者 小柒2012 * 创建时间  2018年4月10日 */@Configurationpublic class MyAdapter implements WebMvcConfigurer{    @Override    public void addViewControllers( ViewControllerRegistry registry ) {        registry.addViewController( "/" ).setViewName( "forward:/login.shtml" );        registry.setOrder( Ordered.HIGHEST_PRECEDENCE );    } }

To solve the problem:

/**     * 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);

Hibernate 5.2 abandoned Setresulttransformer, saying it was to develop a new method of acquiring collections, apparently not yet implemented, in a todo state.

Project Source: Https://gitee.com/52itstyle/spring-boot-task

Integration of springboot2.x Development Case Quartz Task management system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.