Hello,
i run Hibernate with JBoss (JMX) and it works.
Now i'm try to make a Stateless Session Bean that creates the tables from the hbm files for the server startup. Now there are some problems:
1) from within JBoss I can't get a Configuration (with
Code:
Configuration cfg=new Configuration.configure()
) without put an hibernate.cfg.xml in the "sar" directory. There is a way to don't use "hibernate.cfg.xml" and use the informations that are defined in the jboss-service.xml?!
2) who can i create tables?! i thinked with
Code:
cfg.generateSchemaCreationScript(...)
and then get a session, a connection and execute the query returned from generateSchemaCreationScript. It's right?!
3) there is a way to make some check like "there are data into the tables", etc. only using the hbm-files' informations? I'd like to create a SessionJB method "initDB" that check if some tables exist, if they have data and then (if it's needed) create them.
Thanx for any suggest
Giovanni