1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package ch.asynk; public interface AbstractModel<TIdentity, TObject> { boolean isUnsaved(); TObject self(); AbstractMapper<TIdentity, TObject> getDAO(); default void save() { getDAO().save(self()); } default int delete() { return getDAO().delete(self()); } }