In Spring Data JPA, How to add an Entity during runtime ?
问题 In my business, I will to dynamically create model and repository for MySQL. I have successfully create the java file and complied it. then register the bean for repository and service using beanfactory. But I don't have an idea about how to map the Entity. I have searched some similar questions but do not have a clean solution. can anyone help and show me some code samples ? 回答1: JPA works mostly with static schema. There are good reasons for this, see discussion on www.java.net/node/666078