@Test public void query(){ SqlSession.init("root","root","jdbc:mysql: List<User> all = new DBQuery<User>().query(User.class).all(); for (User user : all) { log.info(user.toString()); } }
public DBQuery query(Class<T> clazz) { this.targetClass = clazz; dbTable = super.origin().addTable(targetClass.getAnnotation(OriginName.class).value()) ; return this; }
DBQuery extends SqlSessionFactory { public DBQuery query(Class<T> clazz) { this.targetClass = clazz; dbTable = super.origin().addTable(targetClass.getAnnotation(OriginName.class).value()) ; return this; } }
DBQuery extends SqlSessionFactory { public DBQuery query(Class<T> clazz) { this.targetClass = clazz; dbTable = super.origin().addTable(targetClass.getAnnotation(OriginName.class).value()) ; return this; }  }
DBQuery extends SqlSessionFactory { public DBQuery query(Class<T> clazz) { this.targetClass = clazz; dbTable = super.origin().addTable(targetClass.getAnnotation(OriginName.class).value()) ; return this; }  DBQuery query(Class<T> clazz); DBQuery addCondition(Condition condition); List<T> all(); T first(); }
DBQuery extends SqlSessionFactory { public DBQuery query(Class<T> clazz) { this.targetClass = clazz; dbTable = super.origin().addTable(targetClass.getAnnotation(OriginName.class).value()) ; return this; }  DBQuery query(Class<T> clazz); DBQuery addCondition(Condition condition); List<T> all(); T first();  }