已采纳回答 / LmeetR
spring: profiles: active: dev datasource: driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://127.0.0.1:3306/test username: root password: root jpa: hibernate: ddl-auto: create show-sql: true database-platform: org.h...
2018-03-08
最赞回答 / Dtic
转载@未来_0004 的回答自问自答,找到问题所在了,是由于jdk8的原因,有可能和spring boot的版本也关系,两种方式可选 注册,返回类是Optional<Girl>, Optional是jdk8自带的@GetMapping(value = "/girls/{id}")public Optional<Girl> girlFindOne(@PathVariable("id") Integer id) { //直接用findById查找 //return girl...
2018-03-08
mvn install 的时候报Could not open ServletContext resource [/application.yml] 有人遇到这种情况吗
2018-03-07
报错 spring boot Configuration Annotation Proessor not found in classpath
pom.xml里添加
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
pom.xml里添加
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
2018-03-07
最新回答 / 精慕门1546425
高版本中,也可以使用下面的方法解决1.修改实体类
@Entity @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) public class Girl { … … … }2.GirlController中使用getOne方法替代findOne...
2018-03-07