Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.01
Mapping documents: none
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using: Oracle 10g
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I am new to Hibernate so maybe I'm making a stupid mistake, but all I want to do is generate some basic mapping files from my Java source code. I am using the Hibernate Tools plug in with Eclipse 3.1M6. I have created a console configuration and added the JDBC driver, Java Source, and Java Class directories to the classpath (wasn't sure if I need java source or java classes). I then invoke the "Hibernate Artifact Generation" wizard, specify my console configuration, output directory, and check the "Generate mappings (hbm.xml)" option. The only file that gets generated is a file named "GeneralHbmSettings.hbm.xml" and it doesn't have any mappings in it.
I saw something about a related bug where that file is the only one that gets generated, but that seemed to be for folks that were trying to reverse engineer the schema to generate POJOs AND generate the mapping files. I already have the POJOs and just want to generate mapping files. In fact, it would be nice if the wizard also allowed me to generate the DDL from the mapping file.
As I was trying to get this working, I was not sure and had a ton of questions about how to configure:
1) I don't need to have any database tables right? I'm just trying to create the mapping from POJOs
2) Do I put the path to my java source or my java classes in the console configuration?
3) Do I need to point to the Hibernate.cfg.xml in my source or in my class directory when I am doing console configuration.
4) Do I need X-Doclet tags in my java source to do this?
5) Do I need to specify the mapping resources that I want to generate in my Hibernate.cfg.xml file?
Please help!!! It seems like this should be a very easy thing to do. I just want to get a headstart on my mapping files and database.
Thanks!!!