11package com.faire.yawn.project
22
3- import com.faire.yawn.YawnTableDef
3+ import com.faire.yawn.YawnDef
44import com.faire.yawn.query.YawnCompilationContext
55import org.hibernate.criterion.Projection
66import org.hibernate.criterion.Projections
@@ -28,7 +28,7 @@ object YawnProjections {
2828 }
2929
3030 internal class Count <SOURCE : Any , FROM : Any ?>(
31- private val columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
31+ private val columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
3232 ) : YawnQueryProjection<SOURCE, Long> {
3333 override fun compile (
3434 context : YawnCompilationContext ,
@@ -38,13 +38,13 @@ object YawnProjections {
3838 }
3939
4040 fun <SOURCE : Any , FROM : Any ?> count (
41- columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
41+ columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
4242 ): YawnQueryProjection <SOURCE , Long > {
4343 return Count (columnDef)
4444 }
4545
4646 internal class CountDistinct <SOURCE : Any , FROM : Any ?>(
47- private val columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
47+ private val columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
4848 ) : YawnQueryProjection<SOURCE, Long> {
4949 override fun compile (
5050 context : YawnCompilationContext ,
@@ -54,13 +54,13 @@ object YawnProjections {
5454 }
5555
5656 fun <SOURCE : Any , FROM : Any ?> countDistinct (
57- columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
57+ columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
5858 ): YawnQueryProjection <SOURCE , Long > {
5959 return CountDistinct (columnDef)
6060 }
6161
6262 internal class SumNullable <SOURCE : Any , FROM : Number ?>(
63- private val columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
63+ private val columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
6464 ) : YawnQueryProjection<SOURCE, Long?> {
6565 override fun compile (
6666 context : YawnCompilationContext ,
@@ -71,13 +71,13 @@ object YawnProjections {
7171
7272 @JvmName(" sumNullable" )
7373 fun <SOURCE : Any , FROM : Number ?> sum (
74- columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
74+ columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
7575 ): YawnQueryProjection <SOURCE , Long ?> {
7676 return SumNullable (columnDef)
7777 }
7878
7979 internal class Sum <SOURCE : Any , FROM : Number >(
80- private val columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
80+ private val columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
8181 ) : YawnQueryProjection<SOURCE, Long> {
8282 override fun compile (
8383 context : YawnCompilationContext ,
@@ -87,13 +87,13 @@ object YawnProjections {
8787 }
8888
8989 fun <SOURCE : Any , FROM : Number > sum (
90- columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
90+ columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
9191 ): YawnQueryProjection <SOURCE , Long > {
9292 return Sum (columnDef)
9393 }
9494
9595 internal class AvgNullable <SOURCE : Any , FROM : Any ?>(
96- private val columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
96+ private val columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
9797 ) : YawnQueryProjection<SOURCE, Double?> {
9898 override fun compile (
9999 context : YawnCompilationContext ,
@@ -104,13 +104,13 @@ object YawnProjections {
104104
105105 @JvmName(" avgNullable" )
106106 fun <SOURCE : Any , FROM : Number ?> avg (
107- columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
107+ columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
108108 ): YawnQueryProjection <SOURCE , Double ?> {
109109 return AvgNullable (columnDef)
110110 }
111111
112112 internal class Avg <SOURCE : Any , FROM : Number >(
113- private val columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
113+ private val columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
114114 ) : YawnQueryProjection<SOURCE, Double> {
115115 override fun compile (
116116 context : YawnCompilationContext ,
@@ -120,13 +120,13 @@ object YawnProjections {
120120 }
121121
122122 fun <SOURCE : Any , FROM : Number > avg (
123- columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
123+ columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
124124 ): YawnQueryProjection <SOURCE , Double > {
125125 return Avg (columnDef)
126126 }
127127
128128 internal class Max <SOURCE : Any , FROM : Comparable <FROM >? >(
129- private val columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
129+ private val columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
130130 ) : YawnQueryProjection<SOURCE, FROM> {
131131 override fun compile (
132132 context : YawnCompilationContext ,
@@ -137,13 +137,13 @@ object YawnProjections {
137137 }
138138
139139 fun <SOURCE : Any , FROM : Comparable <FROM >? > max (
140- columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
140+ columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
141141 ): YawnQueryProjection <SOURCE , FROM > {
142142 return Max (columnDef)
143143 }
144144
145145 internal class Min <SOURCE : Any , FROM : Comparable <FROM >? >(
146- private val columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
146+ private val columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
147147 ) : YawnQueryProjection<SOURCE, FROM> {
148148 override fun compile (
149149 context : YawnCompilationContext ,
@@ -154,13 +154,13 @@ object YawnProjections {
154154 }
155155
156156 fun <SOURCE : Any , FROM : Comparable <FROM >? > min (
157- columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
157+ columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
158158 ): YawnQueryProjection <SOURCE , FROM > {
159159 return Min (columnDef)
160160 }
161161
162162 internal class GroupBy <SOURCE : Any , FROM : Any ?>(
163- private val columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
163+ private val columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
164164 ) : YawnQueryProjection<SOURCE, FROM> {
165165 override fun compile (
166166 context : YawnCompilationContext ,
@@ -171,7 +171,7 @@ object YawnProjections {
171171 }
172172
173173 fun <SOURCE : Any , FROM : Any ?> groupBy (
174- columnDef : YawnTableDef <SOURCE , * >.ColumnDef <FROM >,
174+ columnDef : YawnDef <SOURCE , * >.YawnColumnDef <FROM >,
175175 ): YawnQueryProjection <SOURCE , FROM > {
176176 return GroupBy (columnDef)
177177 }
0 commit comments