问题
In my small project I have 3 entity classes. These classes should be "extendable" by the end user by configuration (eg. human readable text based, probably xml). With extendable I mean adding fields and proper JPA annotations (including something like @ManyToOne) to them so the generated class is then a "normal" entity class.
I've already very vaguley heard of javassist, cglib, Aspectj due to using hibernate and spring. However which one would be appropriate to use? Does this work with spring? I mean when the application starts it must
- create the entities from config
- start spring context
- make spring "scan" them (packagesToScan) or Programmatically loading Entity classes with JPA 2.0?
My further question is if there is already some kind of library / tool that includes reading a configuration file and create the entity from it?
来源:https://stackoverflow.com/questions/15394970/spring-jpa-extend-entity-classes-at-load-time-from-configuration