Documentation / Getting started / Kotlin / Model
Related: Trouble Shooting
Model
We can have our entity beans extend io.ebean.Model
. They then have
save()
and delete()
methods.
BaseDomain extends Model ...
import io.ebean.Model;
...
@MappedSuperclass
open class BaseDomain : Model() {
...
}
Now we can just save()
and delete()
them:
Model.save()
val customer = Customer("Hello entity bean")
// insert
customer.save()
// update
customer.name = "Goodbye"
customer.save()
// delete the bean
customer.delete()
Note that Model.save()
and Model.delete()
use the default server
.