Hibernate version: 3.1rc2
I need to have a primary Schema:
system1 that has all the app
specific data. Then I need
User to be in the
security schema.
I set the schema in the hbm file and it is still generated in the
system1 schema.
The table generated in the
system1 schema is
security_user instead of
user in the
security schema. How can I make this work the way I want?
Thanks.
Mapping documents:
User.hbm.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.corp.security">
<class name="User" table="USER" schema="security">
<id name="id" column="ID" access="field">
<generator class="native" />
</id>
<property name="firstName" column="FIRST_NAME" length="32" />
</class>
</hibernate-mapping>
hibernate.cfg.xmlCode:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/system1</property>
<property name="hibernate.connection.username">sys</property>
<property name="hibernate.connection.password">sys</property>
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping resource="com/corp/security/User.hbm.xml"/>
</session-factory>
</hibernate-configuration>