@@ -28,6 +28,7 @@ public typealias AnyTypeInformation = TypeInformation<*, *, *>
2828 * to a [DataColumn] of with values of type [P].
2929 */
3030public open class TypeInformation <J : Any , D : Any , P : Any >(
31+ public open val jdbcSourceType : KType ,
3132 public open val targetSchema : ColumnSchema ,
3233 public open val valuePreprocessor : DbValuePreprocessor <J , D >? ,
3334 public open val columnPostprocessor : DbColumnPostprocessor <D , P >? ,
@@ -55,38 +56,45 @@ public fun TypeInformation<*, *, *>.castToAny(): TypeInformation<Any, Any, Any>
5556// region generic constructors
5657
5758public fun <J : Any , D : Any , P : Any > typeInformationWithProcessingFor (
59+ jdbcSourceType : KType ,
5860 targetSchema : ColumnSchema ,
5961 valuePreprocessor : DbValuePreprocessor <J , D >? ,
6062 columnPostprocessor : DbColumnPostprocessor <D , P >? ,
6163): TypeInformation <J , D , P > =
6264 TypeInformation (
65+ jdbcSourceType = jdbcSourceType,
6366 targetSchema = targetSchema,
6467 valuePreprocessor = valuePreprocessor,
6568 columnPostprocessor = columnPostprocessor,
6669 )
6770
68- public fun <J : Any > typeInformationFor (targetSchema : ColumnSchema ): TypeInformation <J , J , J > =
71+ public fun <J : Any > typeInformationFor (jdbcSourceType : KType , targetSchema : ColumnSchema ): TypeInformation <J , J , J > =
6972 typeInformationWithProcessingFor(
73+ jdbcSourceType = jdbcSourceType,
7074 targetSchema = targetSchema,
7175 valuePreprocessor = null ,
7276 columnPostprocessor = null ,
7377 )
7478
7579public fun <J : Any , D : Any > typeInformationWithPreprocessingFor (
80+ jdbcSourceType : KType ,
7681 targetSchema : ColumnSchema ,
7782 valuePreprocessor : DbValuePreprocessor <J , D >? ,
7883): TypeInformation <J , D , D > =
7984 typeInformationWithProcessingFor(
85+ jdbcSourceType = jdbcSourceType,
8086 targetSchema = targetSchema,
8187 valuePreprocessor = valuePreprocessor,
8288 columnPostprocessor = null ,
8389 )
8490
8591public fun <J : Any , P : Any > typeInformationWithPostprocessingFor (
92+ jdbcSourceType : KType ,
8693 targetSchema : ColumnSchema ,
8794 columnPostprocessor : DbColumnPostprocessor <J , P >? ,
8895): TypeInformation <J , J , P > =
8996 typeInformationWithProcessingFor(
97+ jdbcSourceType = jdbcSourceType,
9098 targetSchema = targetSchema,
9199 valuePreprocessor = null ,
92100 columnPostprocessor = columnPostprocessor,
@@ -97,43 +105,49 @@ public fun <J : Any, P : Any> typeInformationWithPostprocessingFor(
97105// region ValueColumn constructors
98106
99107public fun <J : Any > typeInformationForValueColumnOf (kType : KType ): TypeInformation <J , J , J > =
100- typeInformationFor(targetSchema = ColumnSchema .Value (kType))
108+ typeInformationFor(jdbcSourceType = kType, targetSchema = ColumnSchema .Value (kType))
101109
102110public inline fun <reified J : Any > typeInformationForValueColumnOf (isNullable : Boolean ): TypeInformation <J , J , J > =
103111 typeInformationForValueColumnOf(typeOf<J >().withNullability(isNullable))
104112
105113public fun <J : Any , D : Any > typeInformationWithPreprocessingForValueColumnOf (
114+ jdbcSourceType : KType ,
106115 targetColumnType : KType ,
107116 valuePreprocessor : DbValuePreprocessor <J , D >? ,
108117): TypeInformation <J , D , D > =
109118 typeInformationWithPreprocessingFor(
119+ jdbcSourceType = jdbcSourceType,
110120 targetSchema = ColumnSchema .Value (targetColumnType),
111121 valuePreprocessor = valuePreprocessor,
112122 )
113123
114- public inline fun <J : Any , reified D : Any > typeInformationWithPreprocessingForValueColumnOf (
124+ public inline fun <reified J : Any , reified D : Any > typeInformationWithPreprocessingForValueColumnOf (
115125 isNullable : Boolean ,
116126 valuePreprocessor : DbValuePreprocessor <J , D >? ,
117127): TypeInformation <J , D , D > =
118128 typeInformationWithPreprocessingForValueColumnOf(
129+ jdbcSourceType = typeOf<J >().withNullability(isNullable),
119130 targetColumnType = typeOf<D >().withNullability(isNullable),
120131 valuePreprocessor = valuePreprocessor,
121132 )
122133
123134public fun <J : Any , P : Any > typeInformationWithPostprocessingForValueColumnOf (
135+ jdbcSourceType : KType ,
124136 targetColumnType : KType ,
125137 columnPostprocessor : DbColumnPostprocessor <J , P >? ,
126138): TypeInformation <J , J , P > =
127139 typeInformationWithPostprocessingFor(
140+ jdbcSourceType = jdbcSourceType,
128141 targetSchema = ColumnSchema .Value (targetColumnType),
129142 columnPostprocessor = columnPostprocessor,
130143 )
131144
132- public inline fun <J : Any , reified P : Any > typeInformationWithPostprocessingForValueColumnOf (
145+ public inline fun <reified J : Any , reified P : Any > typeInformationWithPostprocessingForValueColumnOf (
133146 isNullable : Boolean ,
134147 columnPostprocessor : DbColumnPostprocessor <J , P >? ,
135148): TypeInformation <J , J , P > =
136149 typeInformationWithPostprocessingForValueColumnOf(
150+ jdbcSourceType = typeOf<J >().withNullability(isNullable),
137151 targetColumnType = typeOf<P >().withNullability(isNullable),
138152 columnPostprocessor = columnPostprocessor,
139153 )
0 commit comments