Attila
12/13/2024, 12:35 PMclass CaseWhenElse<T>
which sounds good to me, but I failed to create:
CountryTable.selectAll().orderBy( ??? CaseWhenElse ??).orderBy(CountryTable.name, SortOrder.ASC)
Could help me out someone who already did that?
ThanksChantal Loncle
12/13/2024, 3:29 PMval caseCondition = Case()
.When(Op.build { CountryTable.code eq "HU" }, intLiteral(0))
// more .When() branches
.Else(intLiteral(1))
CountryTable
.selectAll()
.orderBy(caseCondition)
.orderBy(CountryTable.name, SortOrder.ASC)
If you want to use the CaseWhenElse
constructor instead, here's how:
val caseCondition2 = CaseWhenElse(
caseWhen = Case().When(Op.build { CountryTable.code eq "HU" }, intLiteral(0)),
elseResult = intLiteral(1)
)
Attila
12/14/2024, 9:28 AMChantal Loncle
12/16/2024, 2:14 PM