I have Spring boot application
@SpringBootApplication
@EntityScan(basePackages = {"${scan.packages}"})
public class MyApplication {
public static void main(String[] args) {
SpringApplication.run(MyApplication.class, args);
}
While reading multiple entity scan packages from one property separated by comma like below?
scan.packages=com.mycompany.model.package1 , com.mycompany.model.package2
I got this exception :
java.lang.IllegalArgumentException: Unknown entity: com.mycompany.model.package2.Myclass
You can scan multiple Entity like this
@EntityScan(basePackages= {"scan.packages1","scan.packages2"})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With