-->
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.  [ 4 posts ] 
Author Message
 Post subject: BUG? hibernate.default_schema
PostPosted: Sat Mar 06, 2004 5:05 pm 
Beginner
Beginner

Joined: Sun Sep 14, 2003 10:54 am
Posts: 36
Hi,

If hibernate.default_schema is specified instead of specifying schema in the class mapping then the hibernate.default_schema does not appear to be applied to the id sequence used by the class.

Code:
<hibernate-mapping schema="test">
    <class name="testClass" table="test" >

        <id name="id" type="int" unsaved-value="0">
            <generator class="seqhilo">
                <param name="sequence">testseq</param>
                <param name="max_lo">1</param>
            </generator>
        </id>
         ...
</hibernate-mapping>


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 08, 2004 8:34 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I would say you're right. Put it to JIRA please

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 08, 2004 8:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This has been raised before and won't be fixed, so don't bother. Its a problem with the design of the Configuration class.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 08, 2004 10:59 am 
Newbie

Joined: Thu Jul 08, 2004 10:49 am
Posts: 1
gavin wrote:
This has been raised before and won't be fixed, so don't bother. Its a problem with the design of the Configuration class.


Workaround:

String resource ="xxx.hbm.xml";

String schemaName = "mySchema";

ClassLoader cl = this.getClass().getClassLoader();
InputStream rsrc = cl.getResourceAsStream(resource);

DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
builder.setEntityResolver(DTD_RESOLVER);
org.w3c.dom.Document doc = builder.parse(rsrc);
String attribute = doc.getDocumentElement().getAttribute("schema");
doc.getDocumentElement().setAttribute("schema", schemaName);

Configuration cfg = new Configuration();
cfg.addDocument(doc);

....

_________________
Simply the best Programming Experience


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