-->
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.  [ 3 posts ] 
Author Message
 Post subject: middlegen tutorial
PostPosted: Mon Mar 29, 2004 3:03 pm 
Beginner
Beginner

Joined: Sun Mar 28, 2004 7:18 pm
Posts: 26
I have tried getting my head around middlgen and would appreciate some help. In simple, layman terms, how does one go about configuring middlegen to an already existing database ?

I have an oracle database that I want middlegen to connect to so that I can generate the hbm.xml files ? How do I do this ? Any specific ant tasks that I would need to change will be helpful.

Any help is as always much appreciated !

S


Top
 Profile  
 
 Post subject: addendum
PostPosted: Mon Mar 29, 2004 3:38 pm 
Beginner
Beginner

Joined: Sun Mar 28, 2004 7:18 pm
Posts: 26
Ok, did some more reading and now it seems to connect to the database, but I keep getting this error :


0: middlegen.MiddlegenException: Middlegen successfully connected to the database, but couldn't find any tables. Perhaps the specified schema or catalog is wrong? -Or maybe there aren't any tables in the database at all?

Here is my oracle.xml :

<!-- please set your Oracle-SID according to your needs -->

<property environment="env"/>

<property name="database.script.file" value="${src.dir}/sql/${name}-oracle.sql"/>
<property name="database.driver.file" value="${env.ORACLE_HOME}/jdbc/lib/classes12.jar"/>
<property name="database.driver.classpath" value="${database.driver.file}"/>
<property name="database.driver" value="oracle.jdbc.driver.OracleDriver"/>
<property name="database.url" value="jdbc:oracle:thin:@xxx.yyy.com:1521:databaseSID"/>
<property name="database.userid" value="straw"/>
<property name="database.password" value="password"/>
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>

<!--property name="jboss.datasource.mapping" value="Oracle7"/-->
<property name="jboss.datasource.mapping" value="Oracle8"/>
<!--property name="jboss.datasource.mapping" value="Oracle9i"/-->


Can anyone tell me what I need to do ? I read that sometimes taking out the schema or the catalog seems to solve the problem, but I tried both and it didnt seem to work.

S


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 30, 2004 1:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
This first step is to get it running against the sample that I supply. For example the R4 release is just about ready to go, eg, set the classpath and your operating.

Another option is to download the Tools demo. This demo includes a middlegen task (tools etc are getting older now). The purpose is to get it to work then move to your own setup.

If you using the demo against oracle etc you do need to get it to build the tables - there is an ant task to to that. The hardest step is always setting up the JDBC driver - this is the same for any JDBC required tool.

I have seen no tables come up (when they should have) in a number of cases where the JDBC driver was buggy (usually a beta version). If this is a problem I suggest you create a small amount of JDBC Java code to test your connection and basic meta data results.


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