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