Skip to content

Commit

Permalink
修复bug,并且添加对@unique & @EndAutoString的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
陈浪 committed May 26, 2020
1 parent 0053c7b commit 836b337
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/ellen/dhcsqlite/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ private void addData() {

//多条数据添加
List<Student> studentList = new ArrayList<>();
for (int i = 0; i < 100; i++) {
for (int i = 1; i < 100; i++) {
student = new Student("Ellen2018_"+i, i, "18272167574", "火星");
father = new Father("Ellen2019", ""+i);
student.setFather(father);
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/java/com/ellen/dhcsqlite/bean/Student.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Student {
@MajorKey(isAutoIncrement = true)
private int id;
@DhcSqlFieldName(sqlFieldName = "my_name") //映射数据库中字段名字为my_name
@EndAutoString("CHECK(name like 'Ellen%')")
@EndAutoString("CHECK(my_name like 'Ellen%')")
private String name;
@DhcSqlFieldName(sqlFieldName = "your_age")
private int age;
Expand All @@ -33,8 +33,6 @@ public class Student {
@SqlType(sqlFiledType = SQLFieldTypeEnum.TEXT, length = 100)
@Operate(operate = OperateEnum.JSON)
@DhcSqlFieldName(sqlFieldName = "your_father")
@Unique
@NotNull
private Father father;
@Operate(operate = OperateEnum.VALUE,valueName = "id")
@SqlType(sqlFiledType = SQLFieldTypeEnum.TEXT, length = 50)
Expand Down

0 comments on commit 836b337

Please sign in to comment.