diff --git a/IX. ‘How-to’ guides/67.4. Separate @Entity definitions from Spring configuration.md b/IX. ‘How-to’ guides/67.4. Separate @Entity definitions from Spring configuration.md index e69de29..b1f8140 100644 --- a/IX. ‘How-to’ guides/67.4. Separate @Entity definitions from Spring configuration.md +++ b/IX. ‘How-to’ guides/67.4. Separate @Entity definitions from Spring configuration.md @@ -0,0 +1,13 @@ +### 67.4. 从Spring配置分离`@Entity`定义 + +Spring Boot会基于它找到的`@EnableAutoConfiguration`来尝试猜测你的`@Entity`定义的位置。想要获取更多控制,你可以使用`@EntityScan`注解,比如: +```java +@Configuration +@EnableAutoConfiguration +@EntityScan(basePackageClasses=City.class) +public class Application { + + //... + +} +```