-->
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: No schema property - middlegen
PostPosted: Fri Feb 13, 2004 12:18 pm 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:32 pm
Posts: 36
Location: S
Hi,

I have several schemas from a Postgress DabaBase. When I execute Hibernate plugin from Middlegen , the property schema of each .hbm.xml generated is not declared.

Is there problems in the hibernate plugin or I need to change some parameter in build.xml ?


Thanks a lot


Pedro Herrera

ps: I


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 14, 2004 12:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The schema setting is set by you manually through the GUI. It is not populated by the database schema settings that you are using.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 14, 2004 1:29 pm 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:32 pm
Posts: 36
Location: S
In Hibernate documentation, ie,



http://www.hibernate.org/98.html


The following code is from the example in documentation

.....




Code:
...
<middlegen
    appname="${name}"
    prefsdir="${src.dir}"
    gui="${gui}"
    databaseurl="${database.url}"
    initialContextFactory="${java.naming.factory.initial}"
    providerURL="${java.naming.provider.url}"
    datasourceJNDIName="${datasource.jndi.name}"
    driver="${database.driver}"
    username="${database.userid}"
    password="${database.password}"
    schema="${database.schema}"
    catalog="${database.catalog}"
  >

     <!-- Plugins -->
     <hibernate
        destination="${build.gen-src.dir}"
        package="${name}.hibernate"
        javaTypeMapper="middlegen.plugins.hibernate.HibernateJavaTypeMapper"
     />

   </middlegen>
   <mkdir dir="${build.classes.dir}"/>
</target>



maping file generated by the plugin :

Code:

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping>
<!--

Created by Middlegen Hibernate plugin
http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/

-->
<class
  name="airline.hibernate.Flight"
  table="flights"
schema="fdgdf"    <----
  proxy="airline.hibernate.Flight"
>


How do you explain that ? Is the doc correct ? property schema is added in mapping file..

Thanks for your help

Pedro Herrera


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 14, 2004 8:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The output you are shown for the flights mapping appears to be random characters. Similar to someone just typing in the characters quickly over the keyboard. Go to the Middlegen GUI for the flights table and see that there is that entry for the schema field. You can clear the field and the schema attribute will disappear.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 15, 2004 9:09 am 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:32 pm
Posts: 36
Location: S
Ok, I've understood your point.

But, I have a database within 2 schemas: each one has 70 tables.

then, Do I have to put manually the schema for each table ? It's a tired work. (140 tables) Do you agree ?

I've thought this kind of work it was provided by middlegen.

Thanks

Pedro Herrera


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 16, 2004 8:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I have been thinking of creating a link between the database attributes to the hibernate plugin for the population of the schema value. Anyway, for the moment, try setting the schema name using the Ant script. eg,

Code:
<hibernate
      destination="${build.gen-src.dir}"
      package="${name}.hibernate"
      databaseSchema="myschema"
/>


Hope this helps.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 18, 2004 6:48 am 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:32 pm
Posts: 36
Location: S
It


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.