增加lock(Sequences sequences, boolean ignoreSeq)、release(Sequences sequences, boolean ignoreSeq)方法
This commit is contained in:
34
README.md
34
README.md
@@ -8,7 +8,7 @@
|
||||
|
||||
使用方法:
|
||||
|
||||
+ 在项目中放置jar包的地方把seq-1.6.2.jar、seq-1.6.2-sources.jar、seq-1.6.2-pom.xml复制过去
|
||||
+ 在项目中放置jar包的地方把seq-1.7.2.jar、seq-1.7.2-sources.jar、seq-1.7.2-pom.xml复制过去
|
||||
+ 在pom.xml中增加以下内容,然后执行maven命令:mvn clean
|
||||
|
||||
```xml
|
||||
@@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>com.yanghuanglin</groupId>
|
||||
<artifactId>seq</artifactId>
|
||||
<version>1.6.2</version>
|
||||
<version>1.7.2</version>
|
||||
<exclusions>
|
||||
<!-- 如若你项目中有引用spring-jdbc,则需要排除seq的jdbc依赖 -->
|
||||
<exclusion>
|
||||
@@ -50,13 +50,13 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- ${project.basedir}表示当前项目的根目录 -->
|
||||
<file>${project.basedir}/lib/seq-1.6.2.jar</file>
|
||||
<pomFile>${project.basedir}/lib/seq-1.6.2-pom.xml</pomFile>
|
||||
<sources>${project.basedir}/lib/seq-1.6.2-sources.jar</sources>
|
||||
<file>${project.basedir}/lib/seq-1.7.2.jar</file>
|
||||
<pomFile>${project.basedir}/lib/seq-1.7.2-pom.xml</pomFile>
|
||||
<sources>${project.basedir}/lib/seq-1.7.2-sources.jar</sources>
|
||||
<repositoryLayout>default</repositoryLayout>
|
||||
<groupId>com.yanghuanglin</groupId>
|
||||
<artifactId>seq</artifactId>
|
||||
<version>1.6.2</version>
|
||||
<version>1.7.2</version>
|
||||
<packaging>jar</packaging>
|
||||
<generatePom>true</generatePom>
|
||||
</configuration>
|
||||
@@ -461,6 +461,17 @@ public interface Generator {
|
||||
*/
|
||||
boolean lock(Sequences sequences);
|
||||
|
||||
/**
|
||||
* 忽略{@link Sequences#getSeq()} ,仅通过{@link Sequences#getKey()}和{@link Sequences#getType()}来锁定序号。
|
||||
* <p/>
|
||||
* 如果ignoreSeq为false,则等价于{@link #lock(Sequences)}
|
||||
*
|
||||
* @param sequences 需要锁定的序号
|
||||
* @param ignoreSeq 是否忽略序号
|
||||
* @return 锁定结果
|
||||
*/
|
||||
boolean lock(Sequences sequences, boolean ignoreSeq);
|
||||
|
||||
/**
|
||||
* 释放所有未使用的序号
|
||||
* <p/>
|
||||
@@ -499,6 +510,16 @@ public interface Generator {
|
||||
*/
|
||||
void release(Sequences sequences);
|
||||
|
||||
/**
|
||||
* 忽略{@link Sequences#getSeq()}来释放指定序号。一般用于业务对象删除后,对应序号需要回收使用时。
|
||||
* <p/>
|
||||
* 如果ignoreSeq为false,则等价于{@link #release(Sequences)}
|
||||
*
|
||||
* @param sequences 需要释放的序号。一般是一个通过{@link Sequences#setKey(String)}、{@link Sequences#setType(String)}、{@link Sequences#setSeq(Long)}三方法一起手动构建或通过{@link Sequences#Sequences(String, String, Long)}构造方法构建的实例对象
|
||||
* @param ignoreSeq 是否忽略序号
|
||||
*/
|
||||
void release(Sequences sequences, boolean ignoreSeq);
|
||||
|
||||
/**
|
||||
* 清空所有闲置序号和未锁定序号
|
||||
*/
|
||||
@@ -524,4 +545,5 @@ public interface Generator {
|
||||
void clearBefore(Date end);
|
||||
}
|
||||
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user