Support seqName in IdTable
I am using the oracle Table Sequence and declaring IdTable to use BatchUpdateStatement. To use BatchUpdateStatement, a table declared with IdTable is required.
```kotlin
ex) object TestTable: IntIdTable(
) {
}
BatchUpdateStatement(TestTable).xxx
```
**Threr are two questions.**
**Question 1. I cannot input sequenceName in IdTable. Therefore, I am using it as shown below. Is it okay to use it this way?**
```kotlin
open class IntIdTableWithAutoIncrementSequence(name: String = "", columnName: String = "id", idSeqName: String? = null) : IdTable<Int>(name) {
/** The identity column of this [IntIdTableWithAutoIncrementSequence], for storing 4-byte integers wrapped as [EntityID] instances. */
final override val id: Column<EntityID<Int>> = integer(columnName).autoIncrement(idSeqName).entityId()
final override val primaryKey = PrimaryKey(id)
}
```
**Question 2. Is it okay to propose a PR for the following content? (idSeqName has been added to the source.)**
```kotlin
open class LongIdTable(name: String = "", columnName: String = "id", idSeqName: String? = null) : IdTable<Long>(name) {
/** The identity column of this [LongIdTable], for storing 8-byte integers wrapped as [EntityID] instances. */
final override val id: Column<EntityID<Long>> = long(columnName).autoIncrement(idSeqName).entityId()
final override val primaryKey = PrimaryKey(id)
}
open class IntIdTable(name: String = "", columnName: String = "id", idSeqName: String? = null) : IdTable<Int>(name) {
/** The identity column of this [IntIdTable], for storing 4-byte integers wrapped as [EntityID] instances. */
final override val id: Column<EntityID<Int>> = integer(columnName).autoIncrement(idSeqName).entityId()
final override val primaryKey = PrimaryKey(id)
}
```
0 条评论