-->
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.  [ 7 posts ] 
Author Message
 Post subject: My helloworld.reveng.xml have no effect ,why?
PostPosted: Wed Jun 03, 2009 9:12 pm 
Newbie

Joined: Wed Jun 03, 2009 8:44 pm
Posts: 4
This is my helloworld.reveng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering
SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd">
<hibernate-reverse-engineering>
<!--
<table-filter match-name=".*" package="hello" />
-->
<table name="MESSAGES" schema="PUBLIC" class="Message" >
<primary-key>
<generator class="increment" />
<key-column name="MESSAGE_ID" property="id" type="long" />
</primary-key>
<column name="MESSAGE_TEXT" property="text" />
<foreign-key constraint-name="FK_NEXT_MESSAGE">
<many-to-one property="nextMessage" />
<set exclude="true" />
</foreign-key>
</table>

</hibernate-reverse-engineering>


This is my helloworld.db.properties

hibernate.dialect = org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class = com.mysql.jdbc.Driver
hibernate.connection.url = jdbc:mysql://localhost:3306/hibernatestudy?useUnicode=true&amp;characterEncoding=GBK
hibernate.connection.username = root
hibernate.connection.password =


Top
 Profile  
 
 Post subject: My helloworld.reveng.xml have no effect ,why?
PostPosted: Wed Jun 03, 2009 9:16 pm 
Newbie

Joined: Wed Jun 03, 2009 8:44 pm
Posts: 4
Sorry,the next is my Messages.hbm.xml,the class is "Messages",not what i wanted "Message",my database is MySQL.
<?xml version="1.0" ?>
<!DOCTYPE hibernate-mapping (View Source for full doctype...)>
- <!-- Generated 2009-6-4 8:36:28 by Hibernate Tools 3.2.0.beta8
-->
- <hibernate-mapping default-cascade="none" default-access="property" default-lazy="true" auto-import="true">
- <class name="Messages" table="messages" catalog="hibernatestudy" mutable="true" polymorphism="implicit" dynamic-update="false" dynamic-insert="false" select-before-update="false" optimistic-lock="version">
<comment />
- <id name="messageId" type="long">
<column name="MESSAGE_ID" />
<generator class="assigned" />
</id>
- <many-to-one name="messages" class="Messages" fetch="select" unique="false" update="true" insert="true" optimistic-lock="true" not-found="exception" embed-xml="true">
- <column name="NEXT_MESSAGE_ID">
<comment />
</column>
</many-to-one>
- <property name="messageText" type="string" unique="false" optimistic-lock="true" lazy="false" generated="never">
- <column name="MESSAGE_TEXT">
<comment />
</column>
</property>
- <set name="messageses" inverse="true" sort="unsorted" mutable="true" optimistic-lock="true" embed-xml="true">
- <key on-delete="noaction">
- <column name="NEXT_MESSAGE_ID">
<comment />
</column>
</key>
<one-to-many class="Messages" not-found="exception" embed-xml="true" />
</set>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Re: My helloworld.reveng.xml have no effect ,why?
PostPosted: Sat Jun 06, 2009 1:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and what is your question ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: My helloworld.reveng.xml have no effect ,why?
PostPosted: Sun Jun 07, 2009 8:07 pm 
Newbie

Joined: Wed Jun 03, 2009 8:44 pm
Posts: 4
I expect the name of the class is "Message",but the tools produce "Messages",why?


Top
 Profile  
 
 Post subject: Re: My helloworld.reveng.xml have no effect ,why?
PostPosted: Mon Jun 08, 2009 4:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the schema is not included in your hbm.xml thus you must have set default_schema somewhere ?

most likely the schema is not actually named PUBLIC

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: My helloworld.reveng.xml have no effect ,why?
PostPosted: Mon Jun 08, 2009 7:27 am 
Newbie

Joined: Wed Jun 03, 2009 8:44 pm
Posts: 4
Thanks a lot!
I modified the helloworld.db.properties,and added the hibernate.default_schema ,then i received what i wanted.

hibernate.dialect = org.hibernate.dialect.MySQLDialect
hibernate.default_schema = information_schema
hibernate.connection.driver_class = com.mysql.jdbc.Driver
hibernate.connection.url = jdbc:mysql://localhost:3306/hibernatestudy?useUnicode=true&amp;characterEncoding=GBK
hibernate.connection.username = root
hibernate.connection.password =


Top
 Profile  
 
 Post subject: Re: My helloworld.reveng.xml have no effect ,why?
PostPosted: Mon Jun 08, 2009 8:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
are you sure your tables are in information_schema ? :)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.