11package org.jetbrains.exposed.dao.r2dbc.tests.shared
22
3+ import org.jetbrains.exposed.r2dbc.dao.IntR2dbcEntity
4+ import org.jetbrains.exposed.r2dbc.dao.IntR2dbcEntityClass
5+ import org.jetbrains.exposed.r2dbc.dao.LongR2dbcEntity
6+ import org.jetbrains.exposed.r2dbc.dao.LongR2dbcEntityClass
37import org.jetbrains.exposed.r2dbc.dao.R2dbcEntity
48import org.jetbrains.exposed.r2dbc.dao.R2dbcEntityClass
5- import org.jetbrains.exposed.r2dbc.dao.R2dbcIntEntity
6- import org.jetbrains.exposed.r2dbc.dao.R2dbcIntEntityClass
7- import org.jetbrains.exposed.r2dbc.dao.R2dbcLongEntity
8- import org.jetbrains.exposed.r2dbc.dao.R2dbcLongEntityClass
99import org.jetbrains.exposed.r2dbc.dao.flushCache
1010import org.jetbrains.exposed.r2dbc.dao.relationships.backReferencedOnSuspend
1111import org.jetbrains.exposed.r2dbc.dao.relationships.optionalBackReferencedOnSuspend
@@ -55,10 +55,10 @@ object EntityTestsData {
5555 A , B
5656 }
5757
58- open class AEntity (id : EntityID <Int >) : R2dbcIntEntity (id) {
58+ open class AEntity (id : EntityID <Int >) : IntR2dbcEntity (id) {
5959 var b1 by XTable .b1
6060
61- companion object : R2dbcIntEntityClass <AEntity >(XTable ) {
61+ companion object : IntR2dbcEntityClass <AEntity >(XTable ) {
6262 fun create (b1 : Boolean , type : XType ): AEntity {
6363 val init : AEntity .() -> Unit = {
6464 this .b1 = b1
@@ -76,7 +76,7 @@ object EntityTestsData {
7676 var b2 by XTable .b2
7777 val y by YEntity optionalReferencedOnSuspend XTable .y1
7878
79- companion object : R2dbcIntEntityClass <BEntity >(XTable ) {
79+ companion object : IntR2dbcEntityClass <BEntity >(XTable ) {
8080 fun create (init : AEntity .() -> Unit ): BEntity {
8181 val answer = new {
8282 init ()
@@ -158,14 +158,14 @@ class R2dbcEntityTests : R2dbcDatabaseTestsBase() {
158158 }
159159
160160 internal object OneAutoFieldTable : IntIdTable(" single" )
161- internal class SingleFieldEntity (id : EntityID <Int >) : R2dbcIntEntity (id) {
162- companion object : R2dbcIntEntityClass < SingleFieldEntity >(OneAutoFieldTable )
161+ internal class SingleFieldR2dbcEntity (id : EntityID <Int >) : IntR2dbcEntity (id) {
162+ companion object : IntR2dbcEntityClass < SingleFieldR2dbcEntity >(OneAutoFieldTable )
163163 }
164164
165165 @Test
166166 fun testOneFieldEntity () {
167167 withTables(OneAutoFieldTable ) {
168- val new = SingleFieldEntity .new { }
168+ val new = SingleFieldR2dbcEntity .new { }
169169 commit()
170170 }
171171 }
@@ -208,24 +208,24 @@ class R2dbcEntityTests : R2dbcDatabaseTestsBase() {
208208 val title = varchar(" title" , 50 )
209209 }
210210
211- class Board (id : EntityID <Int >) : R2dbcIntEntity (id) {
212- companion object : R2dbcIntEntityClass <Board >(Boards )
211+ class Board (id : EntityID <Int >) : IntR2dbcEntity (id) {
212+ companion object : IntR2dbcEntityClass <Board >(Boards )
213213
214214 var name by Boards .name
215215 val posts by Post optionalReferrersOnSuspend Posts .board
216216 }
217217
218- class Post (id : EntityID <Long >) : R2dbcLongEntity (id) {
219- companion object : R2dbcLongEntityClass <Post >(Posts )
218+ class Post (id : EntityID <Long >) : LongR2dbcEntity (id) {
219+ companion object : LongR2dbcEntityClass <Post >(Posts )
220220
221221 val board by Board optionalReferencedOnSuspend Posts .board
222222 val parent by Post optionalReferencedOnSuspend Posts .parent
223223 val category by Category optionalReferencedOnSuspend Posts .category
224224 val optCategory by Category optionalReferencedOnSuspend Posts .optCategory
225225 }
226226
227- class Category (id : EntityID <Int >) : R2dbcIntEntity (id) {
228- companion object : R2dbcIntEntityClass <Category >(Categories )
227+ class Category (id : EntityID <Int >) : IntR2dbcEntity (id) {
228+ companion object : IntR2dbcEntityClass <Category >(Categories )
229229
230230 val uniqueId by Categories .uniqueId
231231 var title by Categories .title
@@ -260,14 +260,14 @@ class R2dbcEntityTests : R2dbcDatabaseTestsBase() {
260260 val name = text(" name" )
261261 }
262262
263- open class Human (id : EntityID <Int >) : R2dbcIntEntity (id) {
264- companion object : R2dbcIntEntityClass <Human >(Humans )
263+ open class Human (id : EntityID <Int >) : IntR2dbcEntity (id) {
264+ companion object : IntR2dbcEntityClass <Human >(Humans )
265265
266266 var h by Humans .h
267267 }
268268
269- class User (id : EntityID <Int >) : R2dbcIntEntity (id) {
270- companion object : R2dbcIntEntityClass <User >(Users ) {
269+ class User (id : EntityID <Int >) : IntR2dbcEntity (id) {
270+ companion object : IntR2dbcEntityClass <User >(Users ) {
271271 fun create (name : String ): User {
272272 val h = Human .new { h = name.take(2 ) }
273273 return User .new(h.id.value) {
0 commit comments