简体   繁体   中英

how to resolve conflicting entities of spring-boot

i have a spring-boot project(project1) in which other two spring-boot projects(project2 & project3) are imported as mvn dependency. project2 and project3 both have entity class with same name ie.entity1 , for a same table tbl1.My project project1 has repository class repo1 for entity class of project2. In My testclass i am using repo1 which supposed to give me object of project2->entity1.At compile time everything seems correct but at the run time the returned object of repo1 is project3->entity1.

jdk12, mvn, spring-boot. Tried checking linking of my test class with repo1 and entity1 at dry-run time.tried by giving full path of repo1(while autowiring it) and giving full package-path of entity1 in repo1.

I think that you need to check the import statements of your project1->repo1 class. In fact, I suppose that project2->entity1 and project3->entity1 have different package name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM