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