Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Paintings: UUIDTable() {
- ...
- val description = text("description").default("")
- ...
- }
- class Painting(id: EntityID<UUID>) : UUIDEntity(id) {
- ...
- var description by Paintings.description
- ...
- }
- class Painting(id: EntityID<UUID>) : UUIDEntity(id) {
- ...
- var description by property<String>()
- fun descriptionProperty() = getProperty(Painting::description)
- ...
- }
- class Painting(id: EntityID<UUID>) : UUIDEntity(id) {
- ...
- var description by Paintings.description notify property<String>()
- fun descriptionProperty() = getProperty(Painting::description)
- ...
- }
- open class Entity<ID:Comparable<ID>>(val id: EntityID<ID>) {
- ...
- operator fun <T> Column<T>.getValue(o: Entity<ID>, desc: KProperty<*>): T =
- lookup()
- operator fun <T> Column<T>.setValue(o: Entity<ID>, desc: KProperty<*>, value: T) {...}
- //Global Extension instead of scoped to `Entity`
- infix fun <T> Column<T>.notify(fxProperty: PropertyDelegate<T>) {
- return DelegateWrapper(this,fxProperty)
- }
- class DelegateWrapper<T>(val column: Column<T>, val fxProperty: PropertyDelegate<T>) {
- operator fun getValue(thisRef: Any?, property: KProperty<*>): String {
- return column.getValue(...) <-cannot resolve getValue
- }
- operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String)
- {
- ...
- }
- }
Add Comment
Please, Sign In to add comment