-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate Eclipse plugin - artifact generation
PostPosted: Tue Aug 30, 2005 9:50 pm 
Newbie

Joined: Tue Aug 30, 2005 9:04 pm
Posts: 9
Hibernate version: 3.0.3
DB: DB2/400

Hello,

I'm trying to run the artifact generation wizard. Here are the steps i've completed so far

1. Created hibernate.cfg.xml below

Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
   PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
   "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
com.ibm.as400.access.AS400JDBCDriver</property>
<property name="hibernate.connection.url">jdbc:as400://theSystem</property>
<property name="hibernate.connection.username">theUsername</property>
<property name="hibernate.connection.password">thePassword</property>
<property name="hibernate.connection.pool_size">5</property>

<!--
<property name="hibernate.connection.isolation">0</property>
<property name="hibernate.connection.autocommit">true</property>
-->
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.DB2400Dialect</property>

</session-factory>
</hibernate-configuration>



2. Created hibernate console configuration using the wizard
* pointed to the configuration file created above
* added external jar pointing to jt400.jar



3. Created hibernate reverse engineering file using the wizard. refresh loaded the schemas correctly. added filter.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>
  <table-filter match-catalog="systemName" match-schema="myLib" match-name="myTable"/>
</hibernate-reverse-engineering>




4. Started Hibernate Artifact generation wizard

* Set the output directory
* checked "Reverse engineer from JDBC connection"
* clicked "Setup" and pointed to an existing reveng.xml file
* checked "Generate mappings (hbm.xml)"
* clicked "Finish". clicked "yes" on first msg box ("start artifact generation")

It processed for a while with a status message at the bottom stating: "generating artifacts for HibernateTest reading jdbc metadata"

After some time i got the following message...

Quote:
"Error under artifact generation

Reason: org.hibernate.exception.GenericJDBCException:Problems getting meta data for primary keys"



i hit "Ok" and returned to the wizard screen.

Anyone know what I'm missing? Any help would be appreciated. Thanks


Top
 Profile  
 
 Post subject: Hibernate Eclipse plugin - artifact generation
PostPosted: Wed Aug 31, 2005 2:21 pm 
Newbie

Joined: Tue Aug 30, 2005 9:04 pm
Posts: 9
update:

The short message was kind of misleading, the real reason is early in the stack trace (at first i didn't know where this was located) it gave a file authorization error

Although I added a filter, it still tried to load everything in my libarary list. So i set up a profile with only the data library i wanted to translate. I may be using the reveng.xml generation incorrectly? Its listed in my previous post. My intention was to only translate the library listed and table listed as matching fields.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 2:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
add a table-filter that excludes everything at the bottom.

i'm thinking i should have that to be the default, but then nothing would be reverse engineering by default....i cant get to an agreement with my self on this one...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 4:06 pm 
Newbie

Joined: Tue Aug 30, 2005 9:04 pm
Posts: 9
Yeahhh finally figured it out. Well kind of makes sense, but usually when you have a list box to the right for selected items, it gives the impression that only those items should be matched. Although i suppose you could have an argument for either way (presence of the exclude button). Either way, thats no big deal.

Wow this is really a cool plugin, im really suprised by how fasttttt it is.

Thanks to the hibernate team!


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