I generated .java files dynamically model, repository, and compiled them into .class format. I used statically @EntityScan and @EnableJpaRepositories to scan packages. Is it possible to dynamically use the .class file to initialize the model and repository? If this is not possible, if I can compile the programmatically and scan dynamically generated Java files in the same cycle of the program?
Asked
Active
Viewed 100 times
2 Answers
0
If I understand your question correctly, the answer should be yes. Did you try it? Package scanning scans the classpath (.class files), not your source code (.java files).

Gregg
- 34,973
- 19
- 109
- 214
0
Generated files .java and .class are in the same package. Scanning the start of the project does not see them. @EntityScan And @EnableJpaRepositories also detect files .class ?, I did not work.

P. null
- 1
- 1
-
Detected entities and added with entytyManagerFactory. However, I can not run a repository with .class. Anyone else have any idea? Is it possible to add some of these classes by ClassLoader or JpaRepository? – P. null Mar 28 '17 at 14:56