cuba-platform / cuba-gradle-plugin

Gradle plugin for building CUBA platform and applications
https://www.cuba-platform.com
Apache License 2.0
15 stars 18 forks source link

Entity enhancing doesn't work properly for Kotlin properties starting with is #123

Closed gorbunkov closed 4 years ago

gorbunkov commented 4 years ago

For setters cuba enhancing adds the code that invokes this.propertyChanged method. If the enhanced entity is a Kotlin entity and the field name starts with "is", e.g. isApproved:

@Table(name = "SAMPLE_CONTRACT")
@Entity(name = "sample_Contract")
class Contract : StandardEntity() {

    @Column(name = "IS_APPROVED")
    var isApproved: Boolean? = null
}

then the propertyChanged invocation is not added to the setter method. This is because Kotlin generate a setter with non-standard name for this case. The setter name will be setApproved, not setIsApproved.

See Kotlin documentation

See related CUBA issue