-->
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.  [ 2 posts ] 
Author Message
 Post subject: Working with two schemas with the schema generator tool
PostPosted: Tue Aug 14, 2007 10:02 am 
Beginner
Beginner

Joined: Thu Jun 30, 2005 5:15 am
Posts: 21
Hi,

I'm trying to work with tables from two schemas using the schema generator tool to create the DDL for them. I don't don't if this scenario sounds familiar to anyone:

1. You have a set of common tables you share among several applications.

2. You create a schema for the shared tables (let's call it 'shared') and the schema for each application.

3. A jar file is created with the shared model entities and its map files. This jar will be used by each application that uses the shared files. It includes all the required domain entities, DAOs, etc.

4. You want use Hibernate and the schema generator tool to create the DDL for the application relational model.

So you have a problem:

When you use the schema generator tool, something like:
Code:
<path id="hibernate.classpath">
      <pathelement location = "${basedir}/WebContent/WEB-INF/lib/shared.jar" />
</path>

<schemaexport config   = "${source.dir}/hibernate_export.cfg.xml"
           quiet      = "no"
            text      = "yes"
           drop      = "no"
            delimiter   = ";"
           output   = "schema-export.sql">

   <fileset dir="${source.dir}">
      <include name="**/*.hbm.xml" />
   </fileset>
</schemaexport>


You get an exception: it doesn't find the entities declared in the file shared.jar with the shared entities. They are needed to create the constraints from the application model (they reference entities in the shared schema as properties or collections).

The question is, do you know if you still can use the schema generator to generate the application schema? It needs to 'know' all the map and class files and at the same time generate just the application ones. I find no way to tell this to it.

Any comment would be really welcome.

Best regards,
Juan


Top
 Profile  
 
 Post subject: Just, is it possible?
PostPosted: Mon Aug 20, 2007 3:36 am 
Beginner
Beginner

Joined: Thu Jun 30, 2005 5:15 am
Posts: 21
Does anyone know if this is possible at least ? Otherwise I could try to convince my boss to let me know a patch for this.

Regards,
Juan


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