# spring_boot_demo **Repository Path**: null_998_6784/springbootdemo ## Basic Information - **Project Name**: spring_boot_demo - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-01-26 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # springbootdemo A.SpringBootBase 0.1.0 (SpringBoot, web, thymeleaf, spring jdbc, jpa) application.yml:server:context-path: /springbootdemo 1.spring jdbc是对java jdbc的一层很薄的分装,并不提供ORM的特性,自己写sql通过jdbcTemplate执行,没有映射entity实体。若要映射实体则需要自定义映射:实现RowMapper public User findUserById(int id) { return jdbcTemplate.queryForObject("select * from users where id=?", new Object[]{id}, new UserRowMapper()); } public List findAll() { return jdbcTemplate.query("select * from users", new UserRowMapper()); } class UserRowMapper implements RowMapper { @Override public User mapRow(ResultSet rs, int rowNum) throws SQLException { User user = new User(); user.setId(rs.getInt("id")); user.setName(rs.getString("name")); user.setEmail(rs.getString("email")); return user; } } 2.spring-data-jpa:整合hibernate,对dao层借接口提供JpaRepository,T对应Entity实体 除了通过解析方法名来创建查询外,它也提供通过使用@Query 注解来创建查询,您只需要编写JPQL语句,并通过类似“:name”来映射@Param指定的参数,就像例子中的第三个findUser函数一样。 B.springbootdemo 0.2.0 (spring boot mybatis tkmapper pageHelper) fatal: Authentication failed for 'https://gitee.com/qssq666/xxxxxx.git/' 解决方法如下: git config --system --unset credential.helper 然后就终于可以重新填写用户名和密码进行提交了。