Skip to content

Commit

Permalink
1.5.8 修复:表无主键时更新表结构sql错误
Browse files Browse the repository at this point in the history
优化:查询列表时,当数量为0时就不在查询列表了,直接返回
新增:索引备注字段,索引支持FullText全文索引方式。
优化:主键、索引一起创建。
  • Loading branch information
785160953 committed Jan 30, 2019
1 parent d2c275e commit 16ba3da
Show file tree
Hide file tree
Showing 5 changed files with 471 additions and 425 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ https://gitee.com/leo_xi/SpringJbaDemo
4. `@Index` (1.5.7+新增)该注解是声明表字段索引的,属性包含如下:(支持继承关系,可以使用父类的属性)
```
1. value 索引名,用于分组,默认为idx_xxxx
2. type 索引类型,默认为普通索引(Normal,Unique)
2. type 索引类型,默认为普通索引(Normal,Unique,FullText
3. order 索引内列顺序,默认0
4. remark (1.5.8+新增)索引的备注
```
----------
Expand Down
1 change: 1 addition & 0 deletions src/main/java/xin/xihc/jba/AnnotationScan.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public void start() {
idx.setIndexName(CommonUtil.isNullEmpty(index.value()) ? "idx_"+field.getName() : index.value());
idx.setOrder(index.order());
idx.setType(index.type());
idx.setRemark(index.remark());
tblP.addIndex(idx);
}
}
Expand Down
81 changes: 46 additions & 35 deletions src/main/java/xin/xihc/jba/annotation/Index.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,51 @@
@Inherited
public @interface Index {

/**
* 索引名,用于分组,默认为idx_xxxx
*/
String value() default "";

/**
* 索引类型,默认为普通索引
*
* @return
*/
IndexType type() default IndexType.Normal;

/**
* 复合索引的顺序,默认0
*
* @return
*/
int order() default 0;


/**
* 索引类型
*/
enum IndexType {
/**
* 唯一索引
*/
Unique,

/**
* 普通索引
*/
Normal;

}
/**
* 索引名,用于分组,默认为idx_xxxx
*/
String value() default "";

/**
* 索引类型,默认为普通索引
*
* @return
*/
IndexType type() default IndexType.Normal;

/**
* 复合索引的顺序,默认0
*
* @return
*/
int order() default 0;

/**
* 索引备注
*
* @return
*/
String remark() default "";


/**
* 索引类型
*/
enum IndexType {
/**
* 唯一索引
*/
Unique,

/**
* 普通索引
*/
Normal,

/**
* 全文索引
*/
FullText;
}

}
Loading

0 comments on commit 16ba3da

Please sign in to comment.