From b1951f5cf2e3cf1937b2dd3301a07d7d373dbfcf Mon Sep 17 00:00:00 2001 From: qibaoguang Date: Thu, 2 Apr 2015 13:05:59 +0800 Subject: [PATCH] Update 67.4. Separate @Entity definitions from Spring configuration.md --- ...ate @Entity definitions from Spring configuration.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 { + + //... + +} +```