<@U69QLRRM3> If you really want observable propert...
# tornadofx
e
@mariofelesdossantosjr If you really want observable properties, then yes 🙂
m
How would you do it? Do you have an example?
Today I do this way
class CfopFX(cfop: Cfop) : ObjectFX() { val codCfopProperty = SimpleObjectProperty(cfop.codcfop) var codCfop by codCfopProperty val descCfopProperty = SimpleStringProperty(cfop.desccfop) var descCfop by descCfopProperty val numeroCfopProperty = SimpleStringProperty(cfop.comcfop) var numeroCfop by numeroCfopProperty fun toPojo() = Cfop( if (this.codCfop == 0) null else this.codCfop, this.descCfop, this.numeroCfop, true) } class CfopModel : ItemViewModel<CfopFX>() { val codCfop = bind(CfopFX::codCfopProperty) val descCfop = bind(CfopFX::descCfopProperty) val numeroCfop = bind(CfopFX::numeroCfopProperty) }
e
Using a DTO is absolutely OK, but it would be nicer to avoid it. Let me set up a Hibernate project and check.
m
ok, I am waiting