简体   繁体   中英

Does Spring Data has a configuration like grails gorm save failOnError?

So we have a project first created with grails using gorm, now we are migrating everything to spring boot, and we are using Spring Data, on gorm hibernate save method, there was an parameter failOnError that throw a grails.validation.ValidationException if validation fails. My question is if I can configure this on Spring Data with hibernate, if yes where I can configure? Can't found on the documentation.

Not that I am aware but it is unnecessary as the function is very simple (AFAIK):

if(Objects.nonNull(userService.save(user))){
    return user;
}else{
    // throw error
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM