-->
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.  [ 1 post ] 
Author Message
 Post subject: SchemaUpdate doesn't prepend schema name
PostPosted: Fri May 07, 2010 2:00 pm 
Newbie

Joined: Thu Mar 04, 2010 10:56 am
Posts: 3
I have an oracle DB as a back end with many schemas.

The important tables:
SCHEMA1.USERS
SCHEMA1.APPLICATION_USERS
SCHEMA1.STUDENTS

The mapping that uses these tables is:

<hibernate-mapping>
<class name="User" table="PERSONS" lazy="false">
<id name="personID" column="PERSON_ID"/>

<property name="lastName" column="LEGAL_SURNAME" />
<property name="firstName" column="LEGAL_FIRST_NAME" />
<property name="lmsUserName" column="WEB_USERNAME" />
<property name="password" column="WEB_PASSWORD" />

<join table="STUDENTS" optional="true">
<key column="PERSON_ID"/>
<property name="studentID" column="STUDENT_ID" unique="true" />
</join>
<join table="APPLICATION_USERS" optional="true">
<key column="PERSON_ID"/>
<property name="sasUserName" column="USERNAME"/>
</join>
</class>
</hibernate-mapping>

When I use this to get or set entries in the DB, Hibernate correctly infers that the Schema is 'SCHEMA1'. I don't have to specify this anywhere. However, when Hibernate is doing a schemaUpdate, no schema is inferred.

An example DDL statement is:
alter table APPLICATION_USERS add constraint FK333CEE196803BBF1 foreign key (PERSON_ID) references PERSONS
Each of these tables should be SCHEMA1.*

If I set the hibernate.default_schema configuration variable to 'SCHEMA1', everything works well. (Related to http://opensource.atlassian.com/project ... wse/HB-819 ?) But when I set schema="SCHEMA1" in either the <hibernate-mapping> tags or <class> tags, it doesn't work.

Is this a bug? Or am I doing something wrong?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.