summaryrefslogtreecommitdiffstats
path: root/java/MyMyBatis/src/ModelMapper.java
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2017-03-24 12:04:14 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2017-03-24 12:04:14 +0100
commit1fa4cec10b4b29c622a89e7f94f4e5269fd644a1 (patch)
tree8a3ae0d06bf96df30fc9aad8c9d16362342b732b /java/MyMyBatis/src/ModelMapper.java
parent724efad67fe61d2c02c41af24ebc352eb79ff2f8 (diff)
downloadshare-1fa4cec10b4b29c622a89e7f94f4e5269fd644a1.zip
share-1fa4cec10b4b29c622a89e7f94f4e5269fd644a1.tar.gz
java : MyMyBatis : minor cleanups
Diffstat (limited to 'java/MyMyBatis/src/ModelMapper.java')
-rw-r--r--java/MyMyBatis/src/ModelMapper.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/java/MyMyBatis/src/ModelMapper.java b/java/MyMyBatis/src/ModelMapper.java
index 6eb566c..77b1921 100644
--- a/java/MyMyBatis/src/ModelMapper.java
+++ b/java/MyMyBatis/src/ModelMapper.java
@@ -10,9 +10,9 @@ import org.apache.ibatis.annotations.Select;
public interface ModelMapper extends AbstractMapper<Model, Integer>
{
final static String attrs = " id, name ";
+ final static String from = " from models ";
final static String where = " where id=#{id} ";
-
final static String INSERT = "insert into models(name) values (#{name})";
@Insert(INSERT)
int insert(Model obj);
@@ -21,19 +21,19 @@ public interface ModelMapper extends AbstractMapper<Model, Integer>
@Update(UPDATE)
int update(Model obj);
- final static String DELETE = "delete from models" + where;
+ final static String DELETE = "delete" + from + where;
@Delete(DELETE)
int delete(Model obj);
- final static String COUNT = "select count(*) from models";
+ final static String COUNT = "select count(*)" + from;
@Select(COUNT)
int count();
- final static String SELECT = "select" + attrs + "from models";
+ final static String SELECT = "select" + attrs + from;
@Select(SELECT)
List<Model> select();
- final static String SELECT_ONE = "select" + attrs + "from models" + where;
+ final static String SELECT_ONE = SELECT + where;
@Select(SELECT_ONE)
Model selectOne(Integer id);
}