Skip to content

Commit

Permalink
fix predicate builder for TimeOnly properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Jan 12, 2024
1 parent f0512fe commit f7b66c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class CsharpQueryPredicateRenderer constructor(val basePackage: String, override
private fun VrapType.toBuilderDsl(propertyName: String, propertyType: AnyType, vrapType: VrapObjectType, isItemType: Boolean = false) : String {
val methodName = propertyName.upperCamelCase()

if (this.simpleName() == "DateTime" || this.simpleName() == "Date" || this.simpleName() == Object::class.java.simpleName) {
if (this.simpleName() == "DateTime" || this.simpleName() == "Date" || this.simpleName() == "TimeSpan" || this.simpleName() == Object::class.java.simpleName) {
return """
|public IComparisonPredicateBuilder<${vrapType.builderDslName()}, ${propertyType.comparisonValue()}> $methodName()
|{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import io.vrap.rmf.raml.model.types.*
import io.vrap.rmf.raml.model.types.Annotation
import io.vrap.rmf.raml.model.util.StringCaseFormat
import java.time.LocalDate
import java.time.LocalTime
import java.time.ZonedDateTime
import javax.lang.model.SourceVersion

Expand Down Expand Up @@ -99,7 +100,7 @@ class JavaQueryPredicateRenderer constructor(val basePackage: String, override v
methodName = "_$methodName"
}

if (this.simpleName() == ZonedDateTime::class.simpleName || this.simpleName() == LocalDate::class.simpleName || this.simpleName() == Object::class.java.simpleName) {
if (this.simpleName() == ZonedDateTime::class.simpleName || this.simpleName() == LocalTime::class.simpleName || this.simpleName() == LocalDate::class.simpleName || this.simpleName() == Object::class.java.simpleName) {
return """
|public ${propertyType.comparisonPredicate()}<${vrapType.builderDslName()}> $methodName() {
| return new ${propertyType.comparisonPredicate()}<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("${propertyName}")),
Expand Down

0 comments on commit f7b66c7

Please sign in to comment.