[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5276?page=c...
]
Fábio Miranda commented on HHH-5276:
------------------------------------
+1
<property name="org.hibernate.envers.default_catalog"
value="mydb_aud" />
both schemas (mydb and mydb_aud) are created with respective tables, but HBM2DDL fails to
create RevInfo FK constraints, because RevInfo table is created in mydb instead of
mydb_aud.
Messages like these are displayed on output after HBM2DDL executes:
14453 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Unsuccessful: alter table
mydb_aud.MyEntity_AUD add index FK9BFC273DC1804980 (REV), add constraint
FK9BFC273DC1804980 foreign key (REV) references RevInfo (id)
14453 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Can't create table
'mydb_aud.#sql-a88_1d4' (errno: 150)
Even not creating FK constraints, the application is able to update RevInfo and *_aud
tables in respective catalogs.
Environment:
Hibernate 3.5.5
MySQL 5.1.26 Community Server / Win XP
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Table REVINFO created in the default schema even if the property is
otherwise set
---------------------------------------------------------------------------------
Key: HHH-5276
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5276
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.5.2
Environment: Hibernate 3.5.2
Mysql (Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (i486))
mysql-connector version 5.1.12
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu3)
OpenJDK Server VM (build 14.0-b16, mixed mode)
Reporter: Pascal-Eric Servais
This issue was first related here :
http://community.jboss.org/message/545287 but here is
a copy.
Partial configuration :
[META-INF/persistence.xml]
<persistence version="2.0"
<persistence-unit name="party"
transaction-type="RESOURCE_LOCAL">
...
<properties>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLDialect" />
<property name="javax.persistence.jdbc.url"
value="jdbc:mysql://localhost/MODEL?useUnicode=true&characterEncoding=UTF-8"
/>
<property name="javax.persistence.jdbc.driver"
value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.user" value="root"
/>
<property name="javax.persistence.jdbc.password" value=""
/>
...
<property name="org.hibernate.envers.default_schema"
value="AUDIT"/>
...
<!-- All EventListeners Are Defined -->
</persistence-unit>
[META-INF/orm.xml]
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0">
<access>FIELD</access>
<entity class="com.company.model.Party">
<table name="PARTY" schema="MODEL" />
...
</entity>
...
</entity-mappings>
As expected, the PARTY table is created into the MODEL schema and the audit table
PARTY_AUD is created into the AUDIT schema. But the REVINFO table is created into the
MODEL schema. According to the property "org.hibernate.envers.default_schema",
it should be created into the AUDIT schema.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira