-
Notifications
You must be signed in to change notification settings - Fork 753
Open
Description
I am using the oracle Table Sequence and declaring IdTable to use BatchUpdateStatement. To use BatchUpdateStatement, a table declared with IdTable is required.
ex) object TestTable: IntIdTable(
) {
}
BatchUpdateStatement(TestTable).xxxThrer 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?
// The existing source
open class IntIdTable(name: String = "", columnName: String = "id") : 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().entityId()
final override val primaryKey = PrimaryKey(id)
}
// The source I developed (idSeqName has been added to the source)
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)
// The existing source
open class LongIdTable(name: String = "", columnName: String = "id") : 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().entityId()
final override val primaryKey = PrimaryKey(id)
}
open class IntIdTable(name: String = "", columnName: String = "id") : 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().entityId()
final override val primaryKey = PrimaryKey(id)
}
// The source I developed (idSeqName has been added to the source)
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)
}Metadata
Metadata
Assignees
Labels
No labels