hi, i'm a hibernate noob.
the problem i am having is mapping to classes that are of unknown structure at startup time. i.e. i have no java class or XML at startup time.
a db table contains the data structure; this must be read first.
i.e. if a there is a table = {name:String, id:String, salary:int} then i need to configure a hibernate object accordingly after startup.
new Configuration().addXML(someGeneratedTable2XMLString);
from what i understand i can't do that once a session factory is built.
because new objects may be defined dynamically, i'd have to rebuild the session factory.
questions :
is it ok to rebuild a session factory. this sounds dubious to me
is there another way to accomplish this? i read something about a dynamic-class feature but never found the docs...it may be a new/future thing?
would i be better off just using JDBC or some non OR tool to do this?
thanks
|