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?