-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
66 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
cyxbs-pages/course/schemas/com.cyxbs.pages.course.page.link.room.LinkDataBase/2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"formatVersion": 1, | ||
"database": { | ||
"version": 2, | ||
"identityHash": "5a13098b79b15e882e26a18c07556425", | ||
"entities": [ | ||
{ | ||
"tableName": "link_stu", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`selfNum` TEXT NOT NULL, `linkNum` TEXT NOT NULL, `linkMajor` TEXT NOT NULL, `linkName` TEXT NOT NULL, `isShowLink` INTEGER NOT NULL, PRIMARY KEY(`selfNum`))", | ||
"fields": [ | ||
{ | ||
"fieldPath": "selfNum", | ||
"columnName": "selfNum", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "linkNum", | ||
"columnName": "linkNum", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "linkMajor", | ||
"columnName": "linkMajor", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "linkName", | ||
"columnName": "linkName", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "isShowLink", | ||
"columnName": "isShowLink", | ||
"affinity": "INTEGER", | ||
"notNull": true | ||
} | ||
], | ||
"primaryKey": { | ||
"autoGenerate": false, | ||
"columnNames": [ | ||
"selfNum" | ||
] | ||
}, | ||
"indices": [], | ||
"foreignKeys": [] | ||
} | ||
], | ||
"views": [], | ||
"setupQueries": [ | ||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", | ||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '5a13098b79b15e882e26a18c07556425')" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import java.io.Serializable | |
* @email [email protected] | ||
* @date 2022/4/23 14:40 | ||
*/ | ||
@Database(entities = [LinkStuEntity::class], version = 1) | ||
@Database(entities = [LinkStuEntity::class], version = 2) | ||
abstract class LinkDataBase : RoomDatabase() { | ||
abstract fun getLinkStuDao(): LinkStuDao | ||
|
||
|
@@ -35,18 +35,16 @@ data class LinkStuEntity( | |
val linkMajor: String, // 关联人的专业 | ||
val linkName: String, // 关联人的姓名 | ||
val isShowLink: Boolean, // 是否显示 | ||
val isBoy: Boolean // 是否是男生 | ||
) : Serializable { | ||
constructor( | ||
linkStu: LinkStudent, | ||
isShowLink: Boolean, | ||
isBoy: Boolean | ||
) : this(linkStu.selfNum, linkStu.linkNum, linkStu.major, linkStu.name, isShowLink, isBoy) | ||
) : this(linkStu.selfNum, linkStu.linkNum, linkStu.major, linkStu.name, isShowLink) | ||
|
||
fun isNull(): Boolean = linkNum.isBlank() || selfNum.isBlank() | ||
fun isNotNull(): Boolean = !isNull() | ||
companion object { | ||
val NULL = LinkStuEntity("", "", "", "", isShowLink = false, isBoy = true) | ||
val NULL = LinkStuEntity("", "", "", "", isShowLink = false) | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters