Skip to content

ppdouble/springboot-mybatis-plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Scheduled

Method 1

multi-thread

@Component
@EnableScheduling
@EnableAsync
public class UpdateRecordMultiScheduledTask {

    @Async
    @Scheduled(cron = "0/10 * * * * ?")
    public void theFirstTask() {
        System.err.println("Multi task +++++ " + LocalDateTime.now());
    }
}

Method 2

@Configuration
@EnableScheduling
public class UpdateRecordScheduledTask {

    @Scheduled(cron = "0/5 * * * * ?")
    public void theFirstTask() {
        System.err.println("Scheduled task: ----- " + LocalDateTime.now());
    }
}

mybatis plus

UPDATE

Using UpdateWrapper.

LambdaUpdateWrapper will get WARNING: An illegal reflective access operation has occurred.

About

mybatis-plus, updatewrapper, java scheduled tasks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages