summaryrefslogtreecommitdiffstats
path: root/java/MyMyBatis/src/Main.java
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2017-04-19 16:52:31 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2017-04-19 16:52:31 +0200
commit4eaaddb6813b0f563c9022e67f7a4d4a2fc8bae1 (patch)
treee0be79c1294562957089ca8641f65d6cf83677af /java/MyMyBatis/src/Main.java
parent6fcde2655e8aedd56bff1de4e85bb83fee15c591 (diff)
downloadshare-4eaaddb6813b0f563c9022e67f7a4d4a2fc8bae1.zip
share-4eaaddb6813b0f563c9022e67f7a4d4a2fc8bae1.tar.gz
java : MyMyBatis : use java 8 default interface implementation to gain free save() and delete() methods
Diffstat (limited to 'java/MyMyBatis/src/Main.java')
-rw-r--r--java/MyMyBatis/src/Main.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/java/MyMyBatis/src/Main.java b/java/MyMyBatis/src/Main.java
index ad371f7..deb274f 100644
--- a/java/MyMyBatis/src/Main.java
+++ b/java/MyMyBatis/src/Main.java
@@ -38,12 +38,12 @@ public class Main
System.out.println("selectOne : " + m.toString());
System.out.println("update ...");
m.setName("adios");
- dao.save(m);
+ m.save();
m = dao.selectOne(2);
failIf(m == null , "selectOne()");
failIf(!m.getName().equals("adios") , "selectOne()");
System.out.println("selectOne : " + m.toString());
- count = dao.delete(m);
+ count = m.delete();
failIf(count != 1, "delete()");
System.out.println("delete : " + count);
count = dao.count();
@@ -51,7 +51,7 @@ public class Main
System.out.println("count : " + count);
System.out.println("insert ...");
m = new Model("HoMySatan");
- count = dao.save(m);
+ m.save();
failIf(count != 1, "insert()");
count = dao.count();
failIf(count != 2, "count()");