-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Is it possible using H3 to gen mapping files from POJOs?
PostPosted: Wed May 04, 2005 1:40 pm 
Newbie

Joined: Wed May 04, 2005 12:44 pm
Posts: 3
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!!!


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 12:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Generation of Mapping files from POJOs is done using Xdoclet. Yes you need the doclet markup in the POJOs to do this. There is information on the Wiki that should get you started. If you are starting with H3 you could start using Annotations and not require any mapping documents.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.