-->
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: how can I see the SQL which creates the TABLE
PostPosted: Sun Oct 15, 2006 11:31 pm 
Newbie

Joined: Sun Oct 15, 2006 11:20 pm
Posts: 13
How can I see the SQL which creates the TABLE?

i am using hibernate 3.1 on linux with Mysql 5.0.

I set these 2 lines in my hibernate.cfg.xml file:
Code:
      <property name="show_sql">true</property>
      <property name="hbm2ddl.auto">create</property>

But i don't see the SQL which hibernate uses to create the tables in the database.

i have also tried to use the schemaexport ANT task to see the database schema, but i get this error. I have make sure the file is located at '/home/ken/eclipseworkspace3/Hibernate/src/events/Event.hbm.xml' and the 'Event.hbm.xml' is from the hibernate.


Code:
BUILD FAILED
/home/ken/eclipseworkspace3/Hibernate/build.xml:45: Schema text failed: Could not read mapping document from file: /home/ken/eclipseworkspace3/Hibernate/src/events/Event.hbm.xml


I am not sure why either way does not work. Anyhelp to get one of the way to work is appreciated.

[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 15, 2006 11:44 pm 
Newbie

Joined: Sun Oct 15, 2006 11:20 pm
Posts: 13
I use the schemaexport target from the hibernate documentation, but it does not work. It fails with the error, but i double check the file is there.

Code:
BUILD FAILED
/home/ken/eclipseworkspace3/Hibernate/build.xml:45: Schema text failed: Could not read mapping document from file: /home/keneclipseworkspace3/Hibernate/src/events/Event.hbm.xml



Code:
<target name="schemaexport">
    <taskdef name="schemaexport"
        classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
        classpathref="libraries"/>
   
    <schemaexport
        properties="src/hibernate.cfg.xml"
        quiet="no"
        text="no"
        drop="no"
        delimiter=";"
        output="schema-export.sql">
        <fileset dir="src">
            <include name="**/*.hbm.xml"/>
        </fileset>
    </schemaexport>
</target>

[/code]


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.