[Hibernate-JIRA] Created: (HBX-980) org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class=
by Matt Braunwart (JIRA)
org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class=
------------------------------------------------------------------------------------------------------
Key: HBX-980
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-980
Project: Hibernate Tools
Issue Type: Bug
Components: eclipse
Affects Versions: 3.2beta7
Environment: Hibernate 3.2 latest, Hibernate Tools 3.2.0, Eclipse 3.3.0
Reporter: Matt Braunwart
I am having an issue with getting the session factory. I have searched and searched for anything referring to this, and the results i find are nothing like the error that I am receiving. If anyone could assist me with this problem, I will be very grateful.
Problem while executing Create SessionFactory(An AnnotationConfiguration instance is required to use <mapping class="movieblends.beans.Tagsuggestions"/>)
org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="movieblends.beans.Tagsuggestions"/>
An AnnotationConfiguration instance is required to use <mapping class="movieblends.beans.Tagsuggestions"/>
org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="movieblends.beans.Tagsuggestions"/>
An AnnotationConfiguration instance is required to use <mapping class="movieblends.beans.Tagsuggestions"/>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Aug 22, 2007 2:31:06 PM by Hibernate Tools 3.2.0.b9 -->
<hibernate-mapping>
<class name="movieblends.beans.Tagsuggestions" table="tagsuggestions" catalog="mbadmins">
<comment></comment>
<id name="messageId" type="int">
<column name="messageID" />
<generator class="assigned" />
</id>
<many-to-one name="user" class="movieblends.beans.User" fetch="select">
<column name="userID" not-null="true">
<comment></comment>
</column>
</many-to-one>
<property name="suggestion" type="string">
<column name="suggestion" not-null="true">
<comment></comment>
</column>
</property>
</class>
</hibernate-mapping>
package movieblends.beans;
// Generated Aug 22, 2007 2:31:06 PM by Hibernate Tools 3.2.0.b9
import java.util.List;
import javax.naming.InitialContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Example;
/**
* Home object for domain model class Tagsuggestions.
* @see movieblends.beans.Tagsuggestions
* @author Hibernate Tools
*/
public class TagsuggestionsHome {
private static final Log log = LogFactory.getLog(TagsuggestionsHome.class);
private final SessionFactory sessionFactory = getSessionFactory();
protected SessionFactory getSessionFactory() {
try {
return (SessionFactory) new InitialContext().lookup("SessionFactory");
} catch (Exception e) {
log.error("Could not locate SessionFactory in JNDI", e);
throw new IllegalStateException("Could not locate SessionFactory in JNDI");
}
}
public void persist(Tagsuggestions transientInstance) {
log.debug("persisting Tagsuggestions instance");
try {
sessionFactory.getCurrentSession().persist(transientInstance);
log.debug("persist successful");
} catch (RuntimeException re) {
log.error("persist failed", re);
throw re;
}
}
public void attachDirty(Tagsuggestions instance) {
log.debug("attaching dirty Tagsuggestions instance");
try {
sessionFactory.getCurrentSession().saveOrUpdate(instance);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public void attachClean(Tagsuggestions instance) {
log.debug("attaching clean Tagsuggestions instance");
try {
sessionFactory.getCurrentSession().lock(instance, LockMode.NONE);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public void delete(Tagsuggestions persistentInstance) {
log.debug("deleting Tagsuggestions instance");
try {
sessionFactory.getCurrentSession().delete(persistentInstance);
log.debug("delete successful");
} catch (RuntimeException re) {
log.error("delete failed", re);
throw re;
}
}
public Tagsuggestions merge(Tagsuggestions detachedInstance) {
log.debug("merging Tagsuggestions instance");
try {
Tagsuggestions result = (Tagsuggestions) sessionFactory.getCurrentSession().merge(detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public Tagsuggestions findById(int id) {
log.debug("getting Tagsuggestions instance with id: " + id);
try {
Tagsuggestions instance = (Tagsuggestions) sessionFactory.getCurrentSession().get(
"movieblends.beans.Tagsuggestions", id);
if (instance == null) {
log.debug("get successful, no instance found");
} else {
log.debug("get successful, instance found");
}
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public List findByExample(Tagsuggestions instance) {
log.debug("finding Tagsuggestions instance by example");
try {
List results = sessionFactory.getCurrentSession().createCriteria("movieblends.beans.Tagsuggestions").add(
Example.create(instance)).list();
log.debug("find by example successful, result size: " + results.size());
return results;
} catch (RuntimeException re) {
log.error("find by example failed", re);
throw re;
}
}
}
package movieblends.beans;
// Generated Aug 22, 2007 2:31:06 PM by Hibernate Tools 3.2.0.b9
/**
* Tagsuggestions generated by hbm2java
*/
public class Tagsuggestions implements java.io.Serializable {
private int messageId;
private User user;
private String suggestion;
public Tagsuggestions() {
}
public Tagsuggestions(int messageId, User user, String suggestion) {
this.messageId = messageId;
this.user = user;
this.suggestion = suggestion;
}
public int getMessageId() {
return this.messageId;
}
public void setMessageId(int messageId) {
this.messageId = messageId;
}
public User getUser() {
return this.user;
}
public void setUser(User user) {
this.user = user;
}
public String getSuggestion() {
return this.suggestion;
}
public void setSuggestion(String suggestion) {
this.suggestion = suggestion;
}
}
<?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 name="mbdb">
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/mbadmins</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping class="movieblends.beans.Tagsuggestions" />
<mapping class="movieblends.beans.Review" />
<mapping class="movieblends.beans.Posts" />
<mapping class="movieblends.beans.Tags" />
<mapping class="movieblends.beans.Movie" />
<mapping class="movieblends.beans.Ratings" />
<mapping class="movieblends.beans.User" />
<mapping class="movieblends.beans.Threads" />
<mapping class="movieblends.beans.Profile" />
</session-factory>
</hibernate-configuration>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<hibernate-reverse-engineering>
<table-filter match-catalog="mbadmins" match-name="keywords"/>
<table-filter match-catalog="mbadmins" match-name="movie"/>
<table-filter match-catalog="mbadmins" match-name="posts"/>
<table-filter match-catalog="mbadmins" match-name="profile"/>
<table-filter match-catalog="mbadmins" match-name="ratings"/>
<table-filter match-catalog="mbadmins" match-name="review"/>
<table-filter match-catalog="mbadmins" match-name="tags"/>
<table-filter match-catalog="mbadmins" match-name="tagsuggestions"/>
<table-filter match-catalog="mbadmins" match-name="threads"/>
<table-filter match-catalog="mbadmins" match-name="user"/>
</hibernate-reverse-engineering>
There is some information on what I have done so far.
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (HBX-946) Add a general meta for all the tables in the database, see [HBX-575]
by Hashim Kubba (JIRA)
Add a general meta for all the tables in the database, see [HBX-575]
--------------------------------------------------------------------
Key: HBX-946
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-946
Project: Hibernate Tools
Issue Type: Improvement
Components: reverse-engineer
Affects Versions: 3.2beta9
Environment: using eclipse 3.2.2
JDK 1.5
hibernate tools 3.2beta9
h2 database ver 1.0
Reporter: Hashim Kubba
Priority: Minor
I'm adding meta attributes in reveng.xml (HBX-575) for customization of the resulting Java code from a reverse engineered database. yet I would really like to be able to add a general class-description to all my classes ( say @ Auther or @version ) , even better; I want all my classes to extend BasicDataObject where I can add some static final constants to use, but now I have to add that to each table
<hibernate-reverse-engineering>
<table name="FOO">
<meta attribute="extends">BasicDataObject</meta>
</table name>
<table name="BOO">
<meta attribute="extends">BasicDataObject</meta>
</table name>
...
</hibernate-reverse-engineering>
What I would like to see is something like
<hibernate-reverse-engineering>
<meta attribute="extends">BasicDataObject</meta>
</hibernate-reverse-engineering>
and that will make all my classes extend BasicDataObject; metas that can be used directly under hibernate-reverse-engineering are:
* class-description general comment for all classes
* implements implements a common interface with constants
* extends extends a common class with constants and common methods
* scope-class make all classes protected
* scope-set all sets in all classes
* scope-get all gets in all classes
A nice to have will be:
* generated-class-suffix
* generated-class-prefix
or <meta name="generated-class" suffix="suffix" prefix="prefix" />
that will allow me to control all the classes names
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (HHH-2641) Collection Loading
by Frederico (JIRA)
Collection Loading
------------------
Key: HHH-2641
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2641
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.0 final
Environment: Hibernate3, Postgresql 8.1
Reporter: Frederico
Attachments: src.tar.gz
I'm not sure if this is a bug, but no one answered me in the hibernate forum, so....
I have a collection that it is not loaded, in log it seems to be ok, but when i access the collection there is no element.
<class
name="entidades.bdufop.Sistema"
table="sistema"
schema="public"
>
<id
name="codigo"
column="codigo"
type="java.lang.String"
>
<generator class="assigned">
</generator>
</id>
<property
name="descricao"
type="java.lang.String"
update="true"
insert="true"
column="descricao"
not-null="true"
/>
<property
name="disponivel"
type="java.lang.String"
update="true"
insert="true"
column="disponivel"
not-null="true"
/>
<property
name="mensagem"
type="java.lang.String"
update="true"
insert="true"
column="mensagem"
/>
<set name="aplicacoes" lazy="true" cascade="all">
<key column="cod_sistema"/>
<one-to-many class="entidades.bdufop.Aplicacao"/>
</set>
</class>
<class
name="entidades.bdufop.Aplicacao"
table="aplicacao"
schema="public"
>
<composite-id
name="id"
class="entidades.bdufop.Aplicacao_pk"
>
<key-property
name="codigo_sistema"
type="java.lang.String"
column="cod_sistema"
/>
<key-property
name="codigo_aplicacao"
type="java.lang.String"
column="codigo"
/>
</composite-id>
<many-to-one name="sistema"
class="entidades.bdufop.Sistema"
column="cod_sistema"
insert="false"
update="false"
unique="true"
not-null="true"/>
<property
name="descricao"
type="java.lang.String"
column="descricao"
not-null="true"
/>
<property
name="versao"
type="java.lang.String"
column="versao"
/>
<property
name="dt_versao"
type="java.util.Date"
column="dt_versao"
/>
<property
name="disponivel"
type="java.lang.String"
column="disponivel"
not-null="true"
/>
<property
name="url"
type="java.lang.String"
column="url"
/>
<property
name="mensagem"
type="java.lang.String"
column="mensagem"
/>
</class>
Log
12:21:42,060 DEBUG DefaultInitializeCollectionEventListener:41 - initializing collection [entidades.bdufop.Sistema.aplicacoes#ACESSO]
12:21:42,063 DEBUG DefaultInitializeCollectionEventListener:47 - checking second-level cache
12:21:42,067 DEBUG DefaultInitializeCollectionEventListener:59 - collection not cached
12:21:42,071 DEBUG Loader:1911 - loading collection: [entidades.bdufop.Sistema.aplicacoes#ACESSO]
12:21:42,075 DEBUG AbstractBatcher:311 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
12:21:42,079 DEBUG ConnectionManager:415 - opening JDBC connection
12:21:42,118 DEBUG SQL:346 - select aplicacoes0_.cod_sistema as cod1_1_, aplicacoes0_.codigo as codigo1_, aplicacoes0_.cod_sistema as cod1_1_0_, aplicacoes0_.codigo as codigo1_0_, aplicacoes0_.descricao as descricao1_0_, aplicacoes0_.versao as versao1_0_, aplicacoes0_.dt_versao as dt5_1_0_, aplicacoes0_.disponivel as disponivel1_0_, aplicacoes0_.url as url1_0_, aplicacoes0_.mensagem as mensagem1_0_ from public.aplicacao aplicacoes0_ where aplicacoes0_.cod_sistema=?
Hibernate: select aplicacoes0_.cod_sistema as cod1_1_, aplicacoes0_.codigo as codigo1_, aplicacoes0_.cod_sistema as cod1_1_0_, aplicacoes0_.codigo as codigo1_0_, aplicacoes0_.descricao as descricao1_0_, aplicacoes0_.versao as versao1_0_, aplicacoes0_.dt_versao as dt5_1_0_, aplicacoes0_.disponivel as disponivel1_0_, aplicacoes0_.url as url1_0_, aplicacoes0_.mensagem as mensagem1_0_ from public.aplicacao aplicacoes0_ where aplicacoes0_.cod_sistema=?
12:21:42,122 DEBUG AbstractBatcher:424 - preparing statement
12:21:42,129 DEBUG StringType:80 - binding 'ACESSO' to parameter: 1
12:21:42,144 DEBUG AbstractBatcher:327 - about to open ResultSet (open ResultSets: 0, globally: 0)
12:21:42,148 DEBUG Loader:1040 - result set contains (possibly empty) collection: [entidades.bdufop.Sistema.aplicacoes#ACESSO]
12:21:42,152 DEBUG CollectionLoadContext:84 - uninitialized collection: initializing
12:21:42,509 DEBUG Loader:682 - processing result set
12:21:42,513 DEBUG Loader:687 - result set row: 0
12:21:42,517 DEBUG StringType:122 - returning 'ACESSO ' as column: cod1_1_0_
12:21:42,542 DEBUG StringType:122 - returning 'AP.ACESSO ' as column: codigo1_0_
12:21:42,550 DEBUG Loader:1164 - result row: EntityKey[entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,558 DEBUG Loader:1347 - Initializing object from ResultSet: [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,563 DEBUG AbstractEntityPersister:1860 - Hydrating entity: [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,574 DEBUG StringType:122 - returning 'ACESSO ' as column: cod1_1_0_
12:21:42,579 DEBUG StringType:122 - returning 'DESCRICAO APLICACAO ACESSO ' as column: descricao1_0_
12:21:42,586 DEBUG StringType:122 - returning ' ' as column: versao1_0_
12:21:42,592 DEBUG TimestampType:122 - returning '2008-01-01 00:00:00' as column: dt5_1_0_
12:21:42,598 DEBUG StringType:122 - returning 'S' as column: disponivel1_0_
12:21:42,602 DEBUG StringType:122 - returning '' as column: url1_0_
12:21:42,608 DEBUG StringType:122 - returning '' as column: mensagem1_0_
12:21:42,613 DEBUG StringType:122 - returning 'ACESSO ' as column: cod1_1_
12:21:42,618 DEBUG Loader:972 - found row of collection: [entidades.bdufop.Sistema.aplicacoes#ACESSO ]
12:21:42,640 DEBUG CollectionLoadContext:100 - new collection: instantiating
12:21:42,659 DEBUG StringType:122 - returning 'ACESSO ' as column: cod1_1_
12:21:42,665 DEBUG StringType:122 - returning 'AP.ACESSO ' as column: codigo1_
12:21:42,671 DEBUG DefaultLoadEventListener:153 - loading entity: [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,677 DEBUG DefaultLoadEventListener:304 - attempting to resolve: [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,687 DEBUG DefaultLoadEventListener:313 - resolved object in session cache: [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,712 DEBUG Loader:709 - done processing result set (1 rows)
12:21:42,716 DEBUG AbstractBatcher:334 - about to close ResultSet (open ResultSets: 1, globally: 1)
12:21:42,721 DEBUG AbstractBatcher:319 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
12:21:42,757 DEBUG AbstractBatcher:470 - closing statement
12:21:42,806 DEBUG ConnectionManager:398 - aggressively releasing JDBC connection
12:21:42,815 DEBUG ConnectionManager:435 - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
12:21:42,821 DEBUG Loader:839 - total objects hydrated: 1
12:21:42,829 DEBUG TwoPhaseLoad:107 - resolving associations for [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,834 DEBUG DefaultLoadEventListener:153 - loading entity: [entidades.bdufop.Sistema#ACESSO ]
12:21:42,874 DEBUG DefaultLoadEventListener:230 - creating new proxy for entity
12:21:43,422 DEBUG TwoPhaseLoad:206 - done materializing entity [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:43,427 DEBUG CollectionLoadContext:262 - 2 collections were found in result set for role: entidades.bdufop.Sistema.aplicacoes
12:21:43,432 DEBUG CollectionLoadContext:206 - collection fully initialized: [entidades.bdufop.Sistema.aplicacoes#ACESSO]
12:21:43,436 DEBUG CollectionLoadContext:206 - collection fully initialized: [entidades.bdufop.Sistema.aplicacoes#ACESSO ]
12:21:43,441 DEBUG CollectionLoadContext:272 - 2 collections initialized for role: entidades.bdufop.Sistema.aplicacoes
12:21:43,445 DEBUG StatefulPersistenceContext:748 - initializing non-lazy collections
12:21:43,449 DEBUG Loader:1935 - done loading collection
12:21:43,453 DEBUG DefaultInitializeCollectionEventListener:61 - collection initialized
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (HHH-2688) HQL: Incorrect join when ordering by property of nullable many-to-one
by Scott Van Wart (JIRA)
HQL: Incorrect join when ordering by property of nullable many-to-one
---------------------------------------------------------------------
Key: HHH-2688
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2688
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.4.sp1
Environment: Oracle 10gR2
Reporter: Scott Van Wart
Attachments: pojos_and_mappings.zip
I have two tables: Parent and Child. Children may not have a parent. I want to select all children, ordering by parent name:
TABLE parent_table ( parent_id NUMBER PRIMARY KEY, parent_name VARCHAR2(30) NOT NULL );
TABLE child_table ( child_id NUMBER PRIMARY KEY, parent_id REFERENCES parent ON DELETE SET NULL );
So I create the two POJOs and mapping documents (attached). After openSession():
List children = session.createQuery( "from Child c order by c.parent.name" ).list();
I only get back the children with parents, because here's the generated SQL, with an INNER join:
select child0_.child_id as child1_17_, child0_.parent_id as parent2_17_
from child_table child0_, parent_table parent1_
where child0_.parent_id=parent1_.parent_id
order by parent1_.parent_name;
Because parent_id in the child table is nullable, I would expect the generated SQL to be:
select child_id, parent_id
from child_table c LEFT JOIN parent_table p ON c.parent_id = p.parent_id
order by p.parent_name;
I guess a workaround might be to specify the join type explicitly in the HQL, but this default behavior kind of surprised me. Thanks.
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (HHH-2751) MappedSuperclass + M:N relation + PostUpdateListener = AssertionFailure: collection [xyz] was not processed by flush()
by S.Schnabl (JIRA)
MappedSuperclass + M:N relation + PostUpdateListener = AssertionFailure: collection [xyz] was not processed by flush()
----------------------------------------------------------------------------------------------------------------------
Key: HHH-2751
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2751
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.4.sp1, 3.2.4, 3.2.3, 3.2.2, 3.2.1
Environment: Windows-XP, Jboss 4.2 GA, Hibernate 3.2.1GA, EJB3
Reporter: S.Schnabl
Attachments: Hibernate-TestCase.rar
For more details see the attached testcase. I'm sorry, but in the short of time i only got a testcase for jboss-server 4.2. Please deploy the server.ear from /release-directory and then call the /src/client/TestCaseClient.java.
Explanation:
I have two entities A.class and B.class defined, both inheriting from an common (empty) abstract MappedSuperclass. A and B having a m:n relation between each other. Furthermore there is an PostUpdateListener, which iterates through all properties of updated entities.
Testcase:
Both entities are linked with each (m:n), now i do an update of a simple property of entity A --> MyPostUpdateListener will be called, which iterates through each property of the updated entity(ies). In case of this property was a collection (= property of the m:n relation), the listener furthermore iterates through this collection and get the id of each object in the collection. Doing so will raise following exception :
Caused by: org.hibernate.AssertionFailure: collection [com.qualitype.testcase.server.ejb.entity.EntityB.entitiesOfA] was not processed by flush()
at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:205)
at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:333)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
... 29 more
Summarized these error will only occur, in case we are inherating from a mappedSuperClass, having a m:n relation and having the listener touching the collection-elements. But these scenario isn'n very uncommon. We are using hibernate-event listener system for auditing-purposes, so you should understand that touching ever (element in the) collectin is necessary for audit-purposes.
Seems for me like a bug. Need this fixed asap ...
--
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
18 years, 1 month