Skip to content

Commit

Permalink
feat: validation in select query
Browse files Browse the repository at this point in the history
(cherry picked from commit 61e6468)
  • Loading branch information
shouwn committed Oct 8, 2023
1 parent abbd404 commit bae640e
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ data class JpqlSelectQuery<T : Any> internal constructor(
val groupBy: Iterable<Expression<*>>?,
val having: Predicate?,
val orderBy: Iterable<Sort>?,
) : SelectQuery<T>
) : SelectQuery<T> {
init {
require(select.any()) {
"There is no select in a select query. The expression list in the select clause may be emptyList."
}

require(from.any()) {
"There is no from in a select query. The from list in the from clause may be emptyList."
}
}
}

0 comments on commit bae640e

Please sign in to comment.