[Hibernate-JIRA] Created: (HHH-5276) Table REVINFO created in the default schema even if the property is otherwise set
by Pascal-Eric Servais (JIRA)
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
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-3008) Cascade delete does not work with unidirectional @OneToMany and @JoinTable
by Daniel Dyer (JIRA)
Cascade delete does not work with unidirectional @OneToMany and @JoinTable
--------------------------------------------------------------------------
Key: HHH-3008
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3008
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.5
Environment: Standalone entity manager (JavaSE 5.0).
H2 database.
Reporter: Daniel Dyer
A unidirectional one-to-many relationship defined as follows:
public class Owner
{
@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name = "owner_element",
joinColumns = @JoinColumn(name = "owner_id",
nullable = false,
updatable = false),
inverseJoinColumns = @JoinColumn(name = "element_id",
nullable = false,
updatable = false))
private List<Element> elements;
// ...
}
Attempting to delete an instance of Owner should also delete all associated instances of Element. Instead I get the following error:
SEVERE: Referential integrity constraint violation: FK56BBF9C487E817D: PUBLIC.OWNER_ELEMENT FOREIGN KEY(OWNER_ID) REFERENCES PUBLIC.OWNER(ID) [23003-63]
This is because Hibernate attempts to delete the Owner row without first removing the rows from the join table.
--
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
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-4073) discriminator formula creates problem in hibernate envers
by Saravana Kumar (JIRA)
discriminator formula creates problem in hibernate envers
---------------------------------------------------------
Key: HHH-4073
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4073
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.3.x
Environment: hibernate-3.3.x, envers-1.2.1.ga-hibernate-3.3.jar (Oracle 10g or HSQLDB)
Reporter: Saravana Kumar
I map my classes using Single Table per class hierarchy as below
@Entity
@DiscriminatorFormula ("(select t.c_type from t_type t where t.c_id = c_type)")
@Audited
public class Attribute...{
...
}
or
<discriminator type="string">
<formula>(select t.c_type from t_type t where t.c_id = c_type)</formula>
</discriminator>
When I use envers
I get the follwoing error
Caused by: java.lang.ClassCastException: org.hibernate.mapping.Formula
at org.hibernate.envers.configuration.metadata.MetadataTools.addColumns(MetadataTools.java:154)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateMappingData(AuditMetadataGenerator.java:263)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:345)
at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:87)
at org.hibernate.envers.configuration.AuditConfiguration.(AuditConfiguration.java:86)
at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)
at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:260)
at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
When I tried to debug the problem
(AuditMetadataGenerator.java:263) has
260: // Checking if there is a discriminator column
261: if (hasDiscriminator) {
262: Element discriminator_element = class_mapping.addElement("discriminator");
263: MetadataTools.addColumns(discriminator_element, pc.getDiscriminator().getColumnIterator());
264: discriminator_element.addAttribute("type", pc.getDiscriminator().getType().getName());
265: }
(MetadataTools.java:154) has
152: public static void addColumns(Element any_mapping, Iterator<Column> columns) {
153: while (columns.hasNext()) {
154: Column column = columns.next();
155: addColumn(any_mapping, column.getName(), column.getLength(), column.getScale(), column.getPrecision(),
156: column.getSqlType());
157: }
158: }
I see that there is nothing to handle Formula :-(
Can you investigate?
--
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
13 years, 8 months