From 0299de6cd679a26ad31f3bc0cb23c572a17cd050 Mon Sep 17 00:00:00 2001 From: Miha_x64 Date: Sat, 14 Mar 2020 11:18:30 +0300 Subject: [PATCH] sql #32: mv blocking.*.structList to .structs 'cause Lazily.structs() gives Iterator, not a list --- .../kotlin/net/aquadc/persistence/sql/blocking/Blocking.kt | 4 ++-- .../test/kotlin/net/aquadc/persistence/sql/TemplatesTest.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/src/main/kotlin/net/aquadc/persistence/sql/blocking/Blocking.kt b/sql/src/main/kotlin/net/aquadc/persistence/sql/blocking/Blocking.kt index 31525db7..a3b266b9 100644 --- a/sql/src/main/kotlin/net/aquadc/persistence/sql/blocking/Blocking.kt +++ b/sql/src/main/kotlin/net/aquadc/persistence/sql/blocking/Blocking.kt @@ -47,7 +47,7 @@ object Eagerly { inline fun > struct(table: Table, bindBy: BindBy): Fetch, StructSnapshot> = FetchStructEagerly(table, bindBy) - inline fun > structList(table: Table, bindBy: BindBy): Fetch, List>> = + inline fun > structs(table: Table, bindBy: BindBy): Fetch, List>> = FetchStructListEagerly(table, bindBy) } @@ -67,7 +67,7 @@ object Lazily { inline fun > struct(table: Table, bindBy: BindBy): Fetch, Lazy>> = FetchStructLazily(table, bindBy) - inline fun > structList(table: Table, bindBy: BindBy): Fetch, CloseableIterator>> = + inline fun > structs(table: Table, bindBy: BindBy): Fetch, CloseableIterator>> = FetchStructListLazily(table, bindBy) inline fun cellByteStream(): Fetch, InputStream> = diff --git a/sql/src/test/kotlin/net/aquadc/persistence/sql/TemplatesTest.kt b/sql/src/test/kotlin/net/aquadc/persistence/sql/TemplatesTest.kt index d1947dc7..e36fe89e 100644 --- a/sql/src/test/kotlin/net/aquadc/persistence/sql/TemplatesTest.kt +++ b/sql/src/test/kotlin/net/aquadc/persistence/sql/TemplatesTest.kt @@ -101,7 +101,7 @@ open class TemplatesTest { val userContacts = session.query( USERS_BY_NAME_AND_EMAIL_START, string, string, - structList, String, DataType.Simple>>, Tuple, String, DataType.Simple>, Struct, Long, DataType.Simple>>, Tuple, Long, DataType.Simple>>>(joined, BindBy.Name) + structs, String, DataType.Simple>>, Tuple, String, DataType.Simple>, Struct, Long, DataType.Simple>>, Tuple, Long, DataType.Simple>>>(joined, BindBy.Name) ) val contacts = userContacts("John", "john") assertEquals(listOf(expectedJohn), contacts) @@ -116,7 +116,7 @@ open class TemplatesTest { val userContacts = session.query( USERS_BY_NAME_AND_EMAIL_START, string, string, - structList, String, DataType.Simple>>, Tuple, String, DataType.Simple>, Struct, Long, DataType.Simple>>, Tuple, Long, DataType.Simple>>>(joined, BindBy.Name) + structs, String, DataType.Simple>>, Tuple, String, DataType.Simple>, Struct, Long, DataType.Simple>>, Tuple, Long, DataType.Simple>>>(joined, BindBy.Name) ) val iter = userContacts("John", "john") // don't collect TemporaryStructs! assertTrue(iter.hasNext())