-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: AssertionFailure - Collection was not processed by flush()
PostPosted: Wed Jun 24, 2009 3:14 pm 
Newbie

Joined: Wed Jun 22, 2005 6:33 pm
Posts: 8
I've got a class, GuestType, that includes a Role. When I save the GuestType, I have a validator to ensure that the Role is enabled:

Code:
@AssertTrue(message = "Role is disabled")
public Boolean validateRole() {
   return this.getRole().isEnabled();
}


When I load up a GuestType and attempt to save it, I get an exception: collection [com.example.orm.Role.Tags] was not processed by flush(). I will include my mappings below.

Does anyone know why this would happen? It seems to be able to load the Role fine during the validation process, but it's angry about something regarding the Tags that belong on that Role.

Any ideas?

Thanks,

Norman

Code:
<class name="com.example.orm.GuestType" table="GuestTypes">
   <id name="Id" column="TypeID">
      <generator class="native"/>
   </id>

   <property name="Name" not-null="true"/>
   <property name="AccessCode" not-null="true"/>
   <property name="Enabled" not-null="true" type="boolean" column="Status"/>

   <many-to-one name="Role" column="RoleID" not-null="true" />
   <many-to-one name="Schedule" column="ScheduleID" not-null="true" />
</class>

<class name="com.example.orm.Role" table="Roles">
   <id name="Id" column="RoleID">
      <generator class="native"/>
   </id>
   
   <property name="Name" not-null="true"/>
   <property name="Enabled" not-null="true" type="boolean" column="Status"/>
   
   <many-to-one name="DefaultSchedule" column="DefaultScheduleID" not-null="true" />

   <list name="Tags" table="TagInstances" cascade="save-update" batch-size="50" where="TagID IN (SELECT t.TagID FROM Tags t WHERE t.Type='r')">
      <key column="AppliesTo" />
      <list-index column="Position" />
      <many-to-many class="com.example.orm.Tag" column="TagID" />
   </list>
</class>

<class name="com.example.orm.Tag" table="Tags">
   <id name="id" column="TagID">
      <generator class="native"/>
   </id>
     
   <discriminator column="Type" type="string" />
   
   <property name="Name" not-null="true"/>
   <property name="Inheritance" type="boolean" not-null="true"/>

   <list name="Elements" table="TagElements" batch-size="30">
      <key column="TagID" />
      <list-index column="Position" />
      <one-to-many class="com.example.orm.TagElement" />       
   </list>
   
   <subclass name="com.example.orm.RoleTag" discriminator-value="r">
   </subclass>
   
   <subclass name="com.example.orm.OwnerTag" discriminator-value="o">
   </subclass>
   
   <subclass name="com.example.orm.ComputerTag" discriminator-value="c">
   </subclass>

   <subclass name="com.example.orm.InfractionReasonTag" discriminator-value="i">
   </subclass>
</class>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.