All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.aqiu202.starters.jpa.anno.OptimisticLockRetry Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
package com.github.aqiu202.starters.jpa.anno;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.persistence.OptimisticLockException;
import org.springframework.core.annotation.AliasFor;
import org.springframework.dao.OptimisticLockingFailureException;

@Documented
@Retention(RUNTIME)
@Target({TYPE, METHOD})
@Retry
public @interface OptimisticLockRetry {

    @AliasFor(annotation = Retry.class)
    Class[] value() default {OptimisticLockException.class,
            OptimisticLockingFailureException.class};

    @AliasFor(annotation = Retry.class)
    Class[] exclude() default {};

    @AliasFor(annotation = Retry.class)
    int times() default 3;

    @AliasFor(annotation = Retry.class)
    String message() default "乐观锁重试次数过多";

    @AliasFor(annotation = Retry.class)
    int delay() default 0;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy