dbo CRUD first iter

This commit is contained in:
2021-11-12 15:11:03 -06:00
parent 01dd8525b1
commit d5e851c57d
32 changed files with 1964 additions and 251 deletions
@@ -25,6 +25,13 @@ public interface Terminal {
public default Terminal meta(Entity ent){
return null;
}
public default <T extends DBO> T load(Class<T> cls,Object...id) throws IOException {
Entity ent=Entity.recall(cls);
String sig="/"+ent.getName()+"/load";
try(Action act=begin(sig).load(ent).limit(1).if_pk(id).execute()){
return (T)act.first();
}
}
public default DBO load(Entity ent,Object...id) throws IOException {
String sig="/"+ent.getName()+"/load";
try(Action act=begin(sig).load(ent).limit(1).if_pk(id).execute()){
@@ -39,6 +46,7 @@ public interface Terminal {
}
}
public default boolean delete(DBO rec) throws IOException {
if(rec==null) return false;
Entity ent=rec.getType();
String sig="/"+ent.getName()+"/delete";
try(Action act=begin(sig).delete(ent).setItems(rec).execute()){