I got the DataModel in the Database Schema already. Following is my approach (at runtime):
Schema -> Mapping Files (.hbm.xml) -> Pojo classes (.java)
Because the Pojo classes simply contain get/set method, I can invoke those methods at the runtime using Reflection API.
The purpose of following this approach is that at compile time I dont have to care about the entity, how it saved and loaded, because the entity is created at the runtime.
The entities and its relation are created at the run time and we design the database schema for it, then update DB. Then we start the program without changing any code because of the automated approach above. That's the whole idea about this.
|