-->
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: Schema value will not work when inserting new objects
PostPosted: Mon Oct 11, 2004 8:39 am 
Newbie

Joined: Mon Oct 11, 2004 8:13 am
Posts: 3
Location: germany
I'm new to Hibernate and i'm trying to save a new object
into the database (DB2) per session.save(obj);

i have to use the schema "ADLER" (the table is called "ADLER.VORGANG"),
the userid is db2inst1.

When selecting objects from the database and updating these objects, everything works fine.
BUT when i create a new object and try to save it, i get an sql-exception that tells me : '"DB2INST1.VORGANG" is an undefined name'.

it seems to me, that only for insert-statements the userid is used instead of "ADLER" as schema name. all the other statements work fine.

Similar problem occured for the user of this thread:
http://forum.hibernate.org/viewtopic.php?t=933449
but the given solution doesn't work for me. I have placed the "schema" attribute into the "class" tag of the mapping file and i'm using the "hibernate.default_schema" property within the hibernate configuration file.

thx for help.
bastian


Top
 Profile  
 
 Post subject: Solution:
PostPosted: Fri Oct 15, 2004 5:28 am 
Newbie

Joined: Mon Oct 11, 2004 8:13 am
Posts: 3
Location: germany
howdy,
finally i found the solution to my problem within this forum:

http://forum.hibernate.org/viewtopic.php?t=930484&highlight=schema+generator
Topic: generator doesen't respect schema of table

this bug seems to be known, but they won't fix 'em. too bad!

the generator doesn't respect the schema of your table and this way the userid is used as schema name instead.

this way it works:
Code:
<generator class="increment" >
   <param name="schema">XXX</param>
</generator>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 15, 2004 6:03 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Provide a patch or buy support hours if you need to get it fixed immediately.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.