Update 67.4. Separate @Entity definitions from Spring configuration.md

master
qibaoguang 2015-04-02 13:05:59 +08:00
parent f9e414e18f
commit b1951f5cf2
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
### 67.4. 从Spring配置分离`@Entity`定义
Spring Boot会基于它找到的`@EnableAutoConfiguration`来尝试猜测你的`@Entity`定义的位置。想要获取更多控制,你可以使用`@EntityScan`注解,比如:
```java
@Configuration
@EnableAutoConfiguration
@EntityScan(basePackageClasses=City.class)
public class Application {
//...
}
```