Hi,
I'm a relaltive newbie to both eclipse and Hibernate.
My version of hibernate tools is 3.2.0 beta 7
Eclipse 3.2 (Callisto release)
Sql Server Express 2005.
hibernate.cfg.xml :
<?xml version="1.0" encoding="UTF-8"?>
<hibernate-configuration>
<session-factory name="sqlexpress">
<property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="hibernate.connection.password">tester</property>
<property name="hibernate.connection.url">jdbc:sqlserver://127.0.0.1:3243;instanceName=SQLEXPRESS;DatabaseName=testDB;SelectMethod=cursor</property>
<property name="hibernate.connection.username">tester</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
</session-factory>
</hibernate-configuration>
What I am attempting to do is to use the tools to creat everything I need from the database. Therefore my understanding is that I first need to creat the reverse engineering file which I did. as follows:
<?xml version="1.0" encoding="UTF-8"?>
<hibernate-reverse-engineering>
<table-filter match-catalog="testDB" match-schema="dbo" match-name=".*"/>
<table-filter match-catalog="testDB" match-schema="dbo" match-name="sysdiagrams" exclude="true"/>
</hibernate-reverse-engineering>
(NB I have problems viewing this using the hibernate editor - it throws an exception
java.lang.NullPointerException
at org.hibernate.eclipse.mapper.model.DOMReverseEngineeringDefinition.<init>(DOMReverseEngineeringDefinition.java:93)
at org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor.initSourcePage(ReverseEngineeringEditor.java:136)
at org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor.addPages(ReverseEngineeringEditor.java:84)
at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:142)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:276)
OK So now i try to use the code generation feature:
reverse engineer from jdbc is selected
output directory is specified, along with package info
the two detect check boxes are selected along with the generate basic ids
No matter which exporters are selected I get the following exception:
Exception while generating code Reason:
IndexOutOfBoundsException: Index:0 Size: 0
My database has no data in it just the structures at this stage.
Have I missed out something fundamentla in the way I'm trying to do this or is there something else I should be setting up.
My databse is being accessed ok because the tool to creat the reverse engineering xml shows all th etables correctly
Help much appreciated.
|