Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Main problem:
We have a fairly small object model:
RuleList (1) <--> (0..*) RuleListToRuleAssoc (0..*) <--> (1) Rule (1) --> Big Chunk o' Data (BCoD)
The idea is that a Rule can belong to many different RuleLists, and RuleLists can contain many different Rules. The important business data hangs off of Rule. The RuleList-RuleListToRuleAssoc link is bidirectional, as is RuleListToRuleAssoc-Rule. There are relevant business reasons for this that cannot be removed. The association object holds ordering information, as well as other business metadata.
We want almost every link there to be eagerly loaded. We know how our data is going to be used and lazy loading would be a waste. The _only_ link we want to be lazy is the one from RuleListToRuleAssoc to RuleList.
And this isn't happening.
When we call session.get(RuleList.class, someID), we find that Hibernate will load from the RuleList down just fine, but then it'll hit Rule and try to walk back up the graph through Rule's Set of RuleListToRuleAssoc objects to other RuleLists (and then down to other Rules, up to yet other RuleLists, etc) The "lazy" RuleList objects _are_ being proxied, but instead of just inserting a proxy and being done, Hibernate fully loads the proxied RuleList data, as well as loading up all its children.
More background: The UI layer only cares about RuleLists down as if it were a unidirectional tree, but the middle tier uses everything as a bidirectional graph. We'd really, really, really rather not have two object models to represent this.
I've tried any number of configuration combinations to try to get this to work... I'm failing. I'm sure there's a config combination that will make this work... I just need some help finding it. ;)
Hibernate version:
3.0.2
Mapping documents:
Code:
<class name="com.X.policy.omodel.RuleList" table="RuleList" lazy="true">
<id name="ID" column="ruleList_id">
<generator class="native" />
</id>
<version name="version" column="version" type="long"/>
<list
name="ruleAssociations"
lazy="false"
inverse="true"
cascade="all-delete-orphan">
<key column="ruleListID" />
<index column="orderIndex" />
<one-to-many class="com.X.policy.omodel.RuleListToRuleAssoc" />
</list>
<!-- SNIP: Business data -->
</class>
<class name="com.X.policy.omodel.RuleListToRuleAssoc" table="RuleListToRuleAssoc" lazy="false">
<id name="ID" column="id">
<generator class="native" />
</id>
<version name="version" column="version" type="long"/>
<many-to-one
name="ruleList"
class="com.X.policy.omodel.RuleList"
cascade="all"
fetch="select"
lazy="true"
column="ruleListID"
not-null="false" />
<many-to-one
name="rule"
class="com.X.policy.omodel.Rule"
cascade="all"
column="ruleID"
lazy="false"
not-null="false" />
<property name="orderIndex" />
</class>
<class name="com.X.policy.omodel.Rule" table="Rule" lazy="false">
<id name="ID" column="rule_id">
<generator class="native"/>
</id>
<version name="version" column="version" type="long"/>
<set name="ruleListAssociations"
inverse="true"
cascade="all"
lazy="false">
<key column="ruleID" />
<one-to-many class="com.X.policy.omodel.RuleListToRuleAssoc"/>
</set>
<!-- SNIP: BCoD -->
</class>
Code between sessionFactory.openSession() and session.close():Mostly these objects will be passed around in a detached state. We only open Sessions for saving and loading data.
Full stack trace of any exception that occurs:No Exception. Hibernate just loads data that I'd rather it didn't... ;)
Name and version of the database you are using:Hypersonic 1.7.2.4
Test code snippet: The idea with only keeping Sessions open to load and save is that since we're detached most of the time, we're taking that to the most extreme during our unit tests.
Code:
public void testRuleToRuleListLazyLoading() throws Exception {
// Create two RuleLists and two Rules. Hook the Rules into both RuleLists.
//
RuleList rl1 = saveAndReloadRuleList(new RuleList(new RuleListIdentifier(corporationId, applicationPoint, "RuleList1")));
RuleList rl2 = saveAndReloadRuleList(new RuleList(new RuleListIdentifier(corporationId, applicationPoint, "RuleList2")));
Rule r1 = new Rule(corporationId, applicationPoint, "Rule1");
Rule r2 = new Rule(corporationId, applicationPoint, "Rule2");
rl1.addRule(r1);
rl2.addRule(r1);
rl2.addRule(r2);
Long rl1ID = saveAndReloadRuleList(rl1).getID();
Long rl2ID = saveAndReloadRuleList(rl2).getID();
// Load up RL1 and be all unattached.
//
System.out.println("LOADING RULE LIST 1");
RuleList loadedRL1 = reloadRuleList(rl1ID);
// Try to navigate to RL2's RuleListToRuleAssoc through Rule. (Should work)
//
System.out.println("GETTING RULE 1");
Rule loadedR = loadedRL1.getRule(0);
System.out.println("GETTING ASSOCIATIONS");
RuleListToRuleAssoc[] loadedRAssocs = (RuleListToRuleAssoc[])loadedR.getRuleListAssociations().toArray(
new RuleListToRuleAssoc[0]);
assertTrue("Should have two RuleListToRuleAssoc objects in our array.", loadedRAssocs.length == 2);
// Try to navigate to RL2 through RL2's RuleListToRuleAssoc. (Should throw a Detached Exception of some kind.)
//
try {
System.out.println("PULLING RULE LISTS FROM ASSOCS");
RuleList x1 = loadedRAssocs[0].getRuleList();
RuleList x2 = loadedRAssocs[1].getRuleList();
System.out.println("MESSING WITH RULE LIST 2");
System.out.println("RL1 : " + x1.getClass().toString());
System.out.println("RL1 id: " + x1.getID());
System.out.println("RL2 : " + x2.getClass().toString());
System.out.println("RL2 id: " + x2.getID());
System.out.println("RL2 r: " + x2.getRules());
fail("Should have thrown a Hibernate Detached Exception while walking up the tree.");
} catch (Exception e) { System.out.println("Exception as expected: " + e.getMessage()); }
}
/**
* Saves and then reloads a given RuleList using two separate Hibernate Sessions.
*/
private RuleList saveAndReloadRuleList(RuleList unsavedRL) {
Session session = sessionFactory.openSession();
session.saveOrUpdate(unsavedRL);
session.flush();
session.close();
return reloadRuleList(unsavedRL.getID());
}
private RuleList reloadRuleList(Long id)
{
Session session = sessionFactory.openSession();
try {
return (RuleList)session.get(RuleList.class, id);
}
finally {
if (session != null) {
session.flush();
session.close();
}
}
}
The generated SQL (show_sql=true):I don't want to make this post any bigger than it already is... The problem isn't with the generated SQL, AFAIK. Let me know if posting this trace is important and I'll get it in here toot sweet.
Debug level Hibernate log excerpt:Going from LOADING RULE LIST 1 onwards... I can give the previous data if useful. If you search for "RuleList#2" and "Rule#2" you can see them being loaded, even though a proxy is created for RuleList#2...
Code:
[junit] LOADING RULE LIST 1
[junit] DEBUG - opened session at timestamp: 4582912190541824
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - object not resolved in any cache: [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - Materializing entity: [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] DEBUG - opening JDBC connection
[junit] DEBUG - total checked-out connections: 0
[junit] DEBUG - using pooled JDBC connection, pool size: 0
[junit] DEBUG - select rulelist0_.ruleList_id as ruleList1_0_, rulelist0_.version as version28_0_, rulelist0_.corporationId as corporat3_28_0_, rulelist0_.applicationPoint as applicat4_28_0_, rulelist0_.name as name28_0_ from RuleList rulelist0_ where rulelist0_.ruleList_id=?
[junit] DEBUG - preparing statement
[junit] DEBUG - binding '1' to parameter: 1
[junit] DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] DEBUG - processing result set
[junit] DEBUG - result set row: 0
[junit] DEBUG - result row: EntityKey[com.X.policy.omodel.RuleList#1]
[junit] DEBUG - Initializing object from ResultSet: [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - Hydrating entity: [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - returning '2' as column: version28_0_
[junit] DEBUG - returning '1' as column: corporat3_28_0_
[junit] DEBUG - returning 'Air-Benchmark' as column: applicat4_28_0_
[junit] DEBUG - returning 'RuleList1' as column: name28_0_
[junit] DEBUG - Version: 2
[junit] DEBUG - done processing result set (1 rows)
[junit] DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] DEBUG - closing statement
[junit] DEBUG - total objects hydrated: 1
[junit] DEBUG - resolving associations for [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - creating collection wrapper:[com.X.policy.omodel.RuleList.ruleAssociations#1]
[junit] DEBUG - done materializing entity [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - initializing non-lazy collections
[junit] DEBUG - initializing collection [com.X.policy.omodel.RuleList.ruleAssociations#1]
[junit] DEBUG - checking second-level cache
[junit] DEBUG - collection not cached
[junit] DEBUG - loading collection: [com.X.policy.omodel.RuleList.ruleAssociations#1]
[junit] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] DEBUG - select ruleassoci0_.ruleListID as ruleListID__, ruleassoci0_.id as id__, ruleassoci0_.orderIndex as orderIndex__, ruleassoci0_.id as id1_, ruleassoci0_.version as version29_1_, ruleassoci0_.ruleListID as ruleListID29_1_, ruleassoci0_.ruleID as ruleID29_1_, ruleassoci0_.orderIndex as orderIndex29_1_, rule1_.rule_id as rule1_0_, rule1_.version as version30_0_, rule1_.name as name30_0_, rule1_.corporationId as corporat4_30_0_, rule1_.applicationPoint as applicat5_30_0_, rule1_.active as active30_0_ from RuleListToRuleAssoc ruleassoci0_ left outer join Rule rule1_ on ruleassoci0_.ruleID=rule1_.rule_id where ruleassoci0_.ruleListID=?
[junit] DEBUG - preparing statement
[junit] DEBUG - binding '1' to parameter: 1
[junit] DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] DEBUG - result set contains (possibly empty) collection: [com.X.policy.omodel.RuleList.ruleAssociations#1]
[junit] DEBUG - uninitialized collection: initializing
[junit] DEBUG - processing result set
[junit] DEBUG - result set row: 0
[junit] DEBUG - returning '1' as column: rule1_0_
[junit] DEBUG - returning '3' as column: id1_
[junit] DEBUG - result row: EntityKey[com.X.policy.omodel.Rule#1], EntityKey[com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - Initializing object from ResultSet: [com.X.policy.omodel.Rule#1]
[junit] DEBUG - Hydrating entity: [com.X.policy.omodel.Rule#1]
[junit] DEBUG - returning '1' as column: version30_0_
[junit] DEBUG - returning 'Rule1' as column: name30_0_
[junit] DEBUG - returning '1' as column: corporat4_30_0_
[junit] DEBUG - returning 'Air-Benchmark' as column: applicat5_30_0_
[junit] DEBUG - returning 'true' as column: active30_0_
[junit] DEBUG - Version: 1
[junit] DEBUG - Initializing object from ResultSet: [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - Hydrating entity: [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - returning '1' as column: version29_1_
[junit] DEBUG - returning '1' as column: ruleListID29_1_
[junit] DEBUG - returning '1' as column: ruleID29_1_
[junit] DEBUG - returning '0' as column: orderIndex29_1_
[junit] DEBUG - Version: 1
[junit] DEBUG - returning '1' as column: ruleListID__
[junit] DEBUG - found row of collection: [com.X.policy.omodel.RuleList.ruleAssociations#1]
[junit] DEBUG - reading row
[junit] DEBUG - returning '3' as column: id__
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - resolved object in session cache: [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - returning '0' as column: orderIndex__
[junit] DEBUG - done processing result set (1 rows)
[junit] DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] DEBUG - closing statement
[junit] DEBUG - total objects hydrated: 2
[junit] DEBUG - resolving associations for [com.X.policy.omodel.Rule#1]
[junit] DEBUG - creating collection wrapper:[com.X.policy.omodel.Rule.ruleListAssociations#1]
[junit] DEBUG - creating collection wrapper:[com.X.policy.omodel.Rule.conditions#1]
[junit] DEBUG - creating collection wrapper:[com.X.policy.omodel.Rule.advices#1]
[junit] DEBUG - done materializing entity [com.X.policy.omodel.Rule#1]
[junit] DEBUG - resolving associations for [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - entity found in session cache
[junit] DEBUG - loading entity: [com.X.policy.omodel.Rule#1]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.Rule#1]
[junit] DEBUG - resolved object in session cache: [com.X.policy.omodel.Rule#1]
[junit] DEBUG - done materializing entity [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - 1 collections were found in result set
[junit] DEBUG - collection fully initialized: [com.X.policy.omodel.RuleList.ruleAssociations#1]
[junit] DEBUG - 1 collections initialized
[junit] DEBUG - done loading collection
[junit] DEBUG - collection initialized
[junit] DEBUG - initializing collection [com.X.policy.omodel.Rule.advices#1]
[junit] DEBUG - checking second-level cache
[junit] DEBUG - collection not cached
[junit] DEBUG - loading collection: [com.X.policy.omodel.Rule.advices#1]
[junit] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] DEBUG - select advices0_.rule_id as rule3___, advices0_.advice_id as advice1___, advices0_.orderIndex as orderIndex__, advices0_.advice_id as advice1_0_, advices0_.version as version33_0_, advices0_.rule_id as rule3_33_0_, advices0_.orderIndex as orderIndex33_0_, advices0_.elementName as elementN5_33_0_ from Advice advices0_ where advices0_.rule_id=?
[junit] DEBUG - preparing statement
[junit] DEBUG - binding '1' to parameter: 1
[junit] DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] DEBUG - result set contains (possibly empty) collection: [com.X.policy.omodel.Rule.advices#1]
[junit] DEBUG - uninitialized collection: initializing
[junit] DEBUG - processing result set
[junit] DEBUG - done processing result set (0 rows)
[junit] DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] DEBUG - closing statement
[junit] DEBUG - total objects hydrated: 0
[junit] DEBUG - 1 collections were found in result set
[junit] DEBUG - collection fully initialized: [com.X.policy.omodel.Rule.advices#1]
[junit] DEBUG - 1 collections initialized
[junit] DEBUG - done loading collection
[junit] DEBUG - collection initialized
[junit] DEBUG - initializing collection [com.X.policy.omodel.Rule.conditions#1]
[junit] DEBUG - checking second-level cache
[junit] DEBUG - collection not cached
[junit] DEBUG - loading collection: [com.X.policy.omodel.Rule.conditions#1]
[junit] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] DEBUG - select conditions0_.rule_id as rule3___, conditions0_.condition_id as condition1___, conditions0_.orderIndex as orderIndex__, conditions0_.condition_id as condition1_0_, conditions0_.version as version31_0_, conditions0_.rule_id as rule3_31_0_, conditions0_.orderIndex as orderIndex31_0_, conditions0_.elementName as elementN5_31_0_, conditions0_.operation as operation31_0_ from Condition conditions0_ where conditions0_.rule_id=?
[junit] DEBUG - preparing statement
[junit] DEBUG - running Session.finalize()
[junit] DEBUG - binding '1' to parameter: 1
[junit] DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] DEBUG - result set contains (possibly empty) collection: [com.X.policy.omodel.Rule.conditions#1]
[junit] DEBUG - uninitialized collection: initializing
[junit] DEBUG - processing result set
[junit] DEBUG - done processing result set (0 rows)
[junit] DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] DEBUG - closing statement
[junit] DEBUG - total objects hydrated: 0
[junit] DEBUG - 1 collections were found in result set
[junit] DEBUG - collection fully initialized: [com.X.policy.omodel.Rule.conditions#1]
[junit] DEBUG - 1 collections initialized
[junit] DEBUG - done loading collection
[junit] DEBUG - collection initialized
[junit] DEBUG - initializing collection [com.X.policy.omodel.Rule.ruleListAssociations#1]
[junit] DEBUG - checking second-level cache
[junit] DEBUG - collection not cached
[junit] DEBUG - loading collection: [com.X.policy.omodel.Rule.ruleListAssociations#1]
[junit] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] DEBUG - select rulelistas0_.ruleID as ruleID__, rulelistas0_.id as id__, rulelistas0_.id as id0_, rulelistas0_.version as version29_0_, rulelistas0_.ruleListID as ruleListID29_0_, rulelistas0_.ruleID as ruleID29_0_, rulelistas0_.orderIndex as orderIndex29_0_ from RuleListToRuleAssoc rulelistas0_ where rulelistas0_.ruleID=?
[junit] DEBUG - preparing statement
[junit] DEBUG - binding '1' to parameter: 1
[junit] DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] DEBUG - result set contains (possibly empty) collection: [com.X.policy.omodel.Rule.ruleListAssociations#1]
[junit] DEBUG - uninitialized collection: initializing
[junit] DEBUG - processing result set
[junit] DEBUG - result set row: 0
[junit] DEBUG - returning '2' as column: id0_
[junit] DEBUG - result row: EntityKey[com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - Initializing object from ResultSet: [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - Hydrating entity: [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - returning '1' as column: version29_0_
[junit] DEBUG - returning '2' as column: ruleListID29_0_
[junit] DEBUG - returning '1' as column: ruleID29_0_
[junit] DEBUG - returning '0' as column: orderIndex29_0_
[junit] DEBUG - Version: 1
[junit] DEBUG - returning '1' as column: ruleID__
[junit] DEBUG - found row of collection: [com.X.policy.omodel.Rule.ruleListAssociations#1]
[junit] DEBUG - reading row
[junit] DEBUG - returning '2' as column: id__
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - resolved object in session cache: [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - result set row: 1
[junit] DEBUG - returning '3' as column: id0_
[junit] DEBUG - result row: EntityKey[com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - returning '1' as column: ruleID__
[junit] DEBUG - found row of collection: [com.X.policy.omodel.Rule.ruleListAssociations#1]
[junit] DEBUG - reading row
[junit] DEBUG - returning '3' as column: id__
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - resolved object in session cache: [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - done processing result set (2 rows)
[junit] DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] DEBUG - closing statement
[junit] DEBUG - total objects hydrated: 1
[junit] DEBUG - resolving associations for [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - creating new proxy for entity
[junit] DEBUG - loading entity: [com.X.policy.omodel.Rule#1]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.Rule#1]
[junit] DEBUG - resolved object in session cache: [com.X.policy.omodel.Rule#1]
[junit] DEBUG - done materializing entity [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - 1 collections were found in result set
[junit] DEBUG - initializing proxy: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - object not resolved in any cache: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - Materializing entity: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] DEBUG - select rulelist0_.ruleList_id as ruleList1_0_, rulelist0_.version as version28_0_, rulelist0_.corporationId as corporat3_28_0_, rulelist0_.applicationPoint as applicat4_28_0_, rulelist0_.name as name28_0_ from RuleList rulelist0_ where rulelist0_.ruleList_id=?
[junit] DEBUG - preparing statement
[junit] DEBUG - binding '2' to parameter: 1
[junit] DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] DEBUG - processing result set
[junit] DEBUG - result set row: 0
[junit] DEBUG - result row: EntityKey[com.X.policy.omodel.RuleList#2]
[junit] DEBUG - Initializing object from ResultSet: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - Hydrating entity: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - returning '2' as column: version28_0_
[junit] DEBUG - returning '1' as column: corporat3_28_0_
[junit] DEBUG - returning 'Air-Benchmark' as column: applicat4_28_0_
[junit] DEBUG - returning 'RuleList2' as column: name28_0_
[junit] DEBUG - Version: 2
[junit] DEBUG - done processing result set (1 rows)
[junit] DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] DEBUG - closing statement
[junit] DEBUG - total objects hydrated: 1
[junit] DEBUG - resolving associations for [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - creating collection wrapper:[com.X.policy.omodel.RuleList.ruleAssociations#2]
[junit] DEBUG - done materializing entity [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - done entity load
[junit] DEBUG - collection fully initialized: [com.X.policy.omodel.Rule.ruleListAssociations#1]
[junit] DEBUG - 1 collections initialized
[junit] DEBUG - done loading collection
[junit] DEBUG - collection initialized
[junit] DEBUG - initializing collection [com.X.policy.omodel.RuleList.ruleAssociations#2]
[junit] DEBUG - checking second-level cache
[junit] DEBUG - collection not cached
[junit] DEBUG - loading collection: [com.X.policy.omodel.RuleList.ruleAssociations#2]
[junit] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] DEBUG - select ruleassoci0_.ruleListID as ruleListID__, ruleassoci0_.id as id__, ruleassoci0_.orderIndex as orderIndex__, ruleassoci0_.id as id1_, ruleassoci0_.version as version29_1_, ruleassoci0_.ruleListID as ruleListID29_1_, ruleassoci0_.ruleID as ruleID29_1_, ruleassoci0_.orderIndex as orderIndex29_1_, rule1_.rule_id as rule1_0_, rule1_.version as version30_0_, rule1_.name as name30_0_, rule1_.corporationId as corporat4_30_0_, rule1_.applicationPoint as applicat5_30_0_, rule1_.active as active30_0_ from RuleListToRuleAssoc ruleassoci0_ left outer join Rule rule1_ on ruleassoci0_.ruleID=rule1_.rule_id where ruleassoci0_.ruleListID=?
[junit] DEBUG - preparing statement
[junit] DEBUG - binding '2' to parameter: 1
[junit] DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] DEBUG - result set contains (possibly empty) collection: [com.X.policy.omodel.RuleList.ruleAssociations#2]
[junit] DEBUG - uninitialized collection: initializing
[junit] DEBUG - processing result set
[junit] DEBUG - result set row: 0
[junit] DEBUG - returning '2' as column: rule1_0_
[junit] DEBUG - returning '1' as column: id1_
[junit] DEBUG - result row: EntityKey[com.X.policy.omodel.Rule#2], EntityKey[com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - Initializing object from ResultSet: [com.X.policy.omodel.Rule#2]
[junit] DEBUG - Hydrating entity: [com.X.policy.omodel.Rule#2]
[junit] DEBUG - returning '1' as column: version30_0_
[junit] DEBUG - returning 'Rule2' as column: name30_0_
[junit] DEBUG - returning '1' as column: corporat4_30_0_
[junit] DEBUG - returning 'Air-Benchmark' as column: applicat5_30_0_
[junit] DEBUG - returning 'true' as column: active30_0_
[junit] DEBUG - Version: 1
[junit] DEBUG - Initializing object from ResultSet: [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - Hydrating entity: [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - returning '1' as column: version29_1_
[junit] DEBUG - returning '2' as column: ruleListID29_1_
[junit] DEBUG - returning '2' as column: ruleID29_1_
[junit] DEBUG - returning '1' as column: orderIndex29_1_
[junit] DEBUG - Version: 1
[junit] DEBUG - returning '2' as column: ruleListID__
[junit] DEBUG - found row of collection: [com.X.policy.omodel.RuleList.ruleAssociations#2]
[junit] DEBUG - reading row
[junit] DEBUG - returning '1' as column: id__
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - resolved object in session cache: [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - returning '1' as column: orderIndex__
[junit] DEBUG - result set row: 1
[junit] DEBUG - returning '1' as column: rule1_0_
[junit] DEBUG - returning '2' as column: id1_
[junit] DEBUG - result row: EntityKey[com.X.policy.omodel.Rule#1], EntityKey[com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - returning '2' as column: ruleListID__
[junit] DEBUG - found row of collection: [com.X.policy.omodel.RuleList.ruleAssociations#2]
[junit] DEBUG - reading row
[junit] DEBUG - returning '2' as column: id__
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - resolved object in session cache: [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - returning '0' as column: orderIndex__
[junit] DEBUG - done processing result set (2 rows)
[junit] DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] DEBUG - closing statement
[junit] DEBUG - total objects hydrated: 2
[junit] DEBUG - resolving associations for [com.X.policy.omodel.Rule#2]
[junit] DEBUG - creating collection wrapper:[com.X.policy.omodel.Rule.ruleListAssociations#2]
[junit] DEBUG - creating collection wrapper:[com.X.policy.omodel.Rule.conditions#2]
[junit] DEBUG - creating collection wrapper:[com.X.policy.omodel.Rule.advices#2]
[junit] DEBUG - done materializing entity [com.X.policy.omodel.Rule#2]
[junit] DEBUG - resolving associations for [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - entity proxy found in session cache
[junit] DEBUG - loading entity: [com.X.policy.omodel.Rule#2]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.Rule#2]
[junit] DEBUG - resolved object in session cache: [com.X.policy.omodel.Rule#2]
[junit] DEBUG - done materializing entity [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - 1 collections were found in result set
[junit] DEBUG - collection fully initialized: [com.X.policy.omodel.RuleList.ruleAssociations#2]
[junit] DEBUG - 1 collections initialized
[junit] DEBUG - done loading collection
[junit] DEBUG - collection initialized
[junit] DEBUG - initializing collection [com.X.policy.omodel.Rule.advices#2]
[junit] DEBUG - checking second-level cache
[junit] DEBUG - collection not cached
[junit] DEBUG - loading collection: [com.X.policy.omodel.Rule.advices#2]
[junit] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] DEBUG - select advices0_.rule_id as rule3___, advices0_.advice_id as advice1___, advices0_.orderIndex as orderIndex__, advices0_.advice_id as advice1_0_, advices0_.version as version33_0_, advices0_.rule_id as rule3_33_0_, advices0_.orderIndex as orderIndex33_0_, advices0_.elementName as elementN5_33_0_ from Advice advices0_ where advices0_.rule_id=?
[junit] DEBUG - preparing statement
[junit] DEBUG - binding '2' to parameter: 1
[junit] DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] DEBUG - result set contains (possibly empty) collection: [com.X.policy.omodel.Rule.advices#2]
[junit] DEBUG - uninitialized collection: initializing
[junit] DEBUG - processing result set
[junit] DEBUG - done processing result set (0 rows)
[junit] DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] DEBUG - closing statement
[junit] DEBUG - total objects hydrated: 0
[junit] DEBUG - 1 collections were found in result set
[junit] DEBUG - collection fully initialized: [com.X.policy.omodel.Rule.advices#2]
[junit] DEBUG - 1 collections initialized
[junit] DEBUG - done loading collection
[junit] DEBUG - collection initialized
[junit] DEBUG - initializing collection [com.X.policy.omodel.Rule.conditions#2]
[junit] DEBUG - checking second-level cache
[junit] DEBUG - collection not cached
[junit] DEBUG - loading collection: [com.X.policy.omodel.Rule.conditions#2]
[junit] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] DEBUG - select conditions0_.rule_id as rule3___, conditions0_.condition_id as condition1___, conditions0_.orderIndex as orderIndex__, conditions0_.condition_id as condition1_0_, conditions0_.version as version31_0_, conditions0_.rule_id as rule3_31_0_, conditions0_.orderIndex as orderIndex31_0_, conditions0_.elementName as elementN5_31_0_, conditions0_.operation as operation31_0_ from Condition conditions0_ where conditions0_.rule_id=?
[junit] DEBUG - preparing statement
[junit] DEBUG - binding '2' to parameter: 1
[junit] DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] DEBUG - result set contains (possibly empty) collection: [com.X.policy.omodel.Rule.conditions#2]
[junit] DEBUG - uninitialized collection: initializing
[junit] DEBUG - processing result set
[junit] DEBUG - done processing result set (0 rows)
[junit] DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] DEBUG - closing statement
[junit] DEBUG - total objects hydrated: 0
[junit] DEBUG - 1 collections were found in result set
[junit] DEBUG - collection fully initialized: [com.X.policy.omodel.Rule.conditions#2]
[junit] DEBUG - 1 collections initialized
[junit] DEBUG - done loading collection
[junit] DEBUG - collection initialized
[junit] DEBUG - initializing collection [com.X.policy.omodel.Rule.ruleListAssociations#2]
[junit] DEBUG - checking second-level cache
[junit] DEBUG - collection not cached
[junit] DEBUG - loading collection: [com.X.policy.omodel.Rule.ruleListAssociations#2]
[junit] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] DEBUG - select rulelistas0_.ruleID as ruleID__, rulelistas0_.id as id__, rulelistas0_.id as id0_, rulelistas0_.version as version29_0_, rulelistas0_.ruleListID as ruleListID29_0_, rulelistas0_.ruleID as ruleID29_0_, rulelistas0_.orderIndex as orderIndex29_0_ from RuleListToRuleAssoc rulelistas0_ where rulelistas0_.ruleID=?
[junit] DEBUG - preparing statement
[junit] DEBUG - binding '2' to parameter: 1
[junit] DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] DEBUG - result set contains (possibly empty) collection: [com.X.policy.omodel.Rule.ruleListAssociations#2]
[junit] DEBUG - uninitialized collection: initializing
[junit] DEBUG - processing result set
[junit] DEBUG - result set row: 0
[junit] DEBUG - returning '1' as column: id0_
[junit] DEBUG - result row: EntityKey[com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - returning '2' as column: ruleID__
[junit] DEBUG - found row of collection: [com.X.policy.omodel.Rule.ruleListAssociations#2]
[junit] DEBUG - reading row
[junit] DEBUG - returning '1' as column: id__
[junit] DEBUG - loading entity: [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - attempting to resolve: [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - resolved object in session cache: [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - done processing result set (1 rows)
[junit] DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] DEBUG - closing statement
[junit] DEBUG - total objects hydrated: 0
[junit] DEBUG - 1 collections were found in result set
[junit] DEBUG - collection fully initialized: [com.X.policy.omodel.Rule.ruleListAssociations#2]
[junit] DEBUG - 1 collections initialized
[junit] DEBUG - done loading collection
[junit] DEBUG - collection initialized
[junit] DEBUG - done entity load
[junit] DEBUG - flushing session
[junit] DEBUG - processing flush-time cascades
[junit] DEBUG - processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.RuleList
[junit] DEBUG - cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.RuleList.ruleAssociations
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - persistent instance of: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - done cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.RuleList.ruleAssociations
[junit] DEBUG - deleting orphans for collection: com.X.policy.omodel.RuleList.ruleAssociations
[junit] DEBUG - done deleting orphans for collection: com.X.policy.omodel.RuleList.ruleAssociations
[junit] DEBUG - done processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.RuleList
[junit] DEBUG - processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.Rule
[junit] DEBUG - cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.ruleListAssociations
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - persistent instance of: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.RuleListToRuleAssoc#3]
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - persistent instance of: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - done cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.ruleListAssociations
[junit] DEBUG - cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.conditions
[junit] DEBUG - done cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.conditions
[junit] DEBUG - cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.advices
[junit] DEBUG - done cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.advices
[junit] DEBUG - done processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.Rule
[junit] DEBUG - processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.RuleList
[junit] DEBUG - persistent instance of: com.X.policy.omodel.RuleList
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.RuleList#1]
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.Rule
[junit] DEBUG - persistent instance of: com.X.policy.omodel.Rule
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.Rule#1]
[junit] DEBUG - done processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.RuleList
[junit] DEBUG - persistent instance of: com.X.policy.omodel.RuleList
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.Rule
[junit] DEBUG - persistent instance of: com.X.policy.omodel.Rule
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.Rule#1]
[junit] DEBUG - done processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.RuleList
[junit] DEBUG - cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.RuleList.ruleAssociations
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - persistent instance of: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.RuleListToRuleAssoc#2]
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - persistent instance of: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - done cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.RuleList.ruleAssociations
[junit] DEBUG - deleting orphans for collection: com.X.policy.omodel.RuleList.ruleAssociations
[junit] DEBUG - done deleting orphans for collection: com.X.policy.omodel.RuleList.ruleAssociations
[junit] DEBUG - done processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.RuleList
[junit] DEBUG - processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.Rule
[junit] DEBUG - cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.ruleListAssociations
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - persistent instance of: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.RuleListToRuleAssoc#1]
[junit] DEBUG - done cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.ruleListAssociations
[junit] DEBUG - cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.conditions
[junit] DEBUG - done cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.conditions
[junit] DEBUG - cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.advices
[junit] DEBUG - done cascade ACTION_SAVE_UPDATE for collection: com.X.policy.omodel.Rule.advices
[junit] DEBUG - done processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.Rule
[junit] DEBUG - processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.RuleList
[junit] DEBUG - persistent instance of: com.X.policy.omodel.RuleList
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.RuleList#2]
[junit] DEBUG - cascading to saveOrUpdate: com.X.policy.omodel.Rule
[junit] DEBUG - persistent instance of: com.X.policy.omodel.Rule
[junit] DEBUG - ignoring persistent instance
[junit] DEBUG - object already associated with session: [com.X.policy.omodel.Rule#2]
[junit] DEBUG - done processing cascade ACTION_SAVE_UPDATE for: com.X.policy.omodel.RuleListToRuleAssoc
[junit] DEBUG - dirty checking collections
[junit] DEBUG - Flushing entities and processing referenced collections
[junit] DEBUG - Collection found: [com.X.policy.omodel.RuleList.ruleAssociations#1], was: [com.X.policy.omodel.RuleList.ruleAssociations#1] (initialized)
[junit] DEBUG - Collection found: [com.X.policy.omodel.Rule.ruleListAssociations#1], was: [com.X.policy.omodel.Rule.ruleListAssociations#1] (initialized)
[junit] DEBUG - Collection found: [com.X.policy.omodel.Rule.conditions#1], was: [com.X.policy.omodel.Rule.conditions#1] (initialized)
[junit] DEBUG - Collection found: [com.X.policy.omodel.Rule.advices#1], was: [com.X.policy.omodel.Rule.advices#1] (initialized)
[junit] INFO - cleaning up connection pool: jdbc:hsqldb:file:target/TestDB
[junit] DEBUG - running Session.finalize()
[junit] DEBUG - running Session.finalize()
[junit] DEBUG - running Session.finalize()
[junit] DEBUG - Collection found: [com.X.policy.omodel.RuleList.ruleAssociations#2], was: [com.X.policy.omodel.RuleList.ruleAssociations#2] (initialized)
[junit] DEBUG - Collection found: [com.X.policy.omodel.Rule.ruleListAssociations#2], was: [com.X.policy.omodel.Rule.ruleListAssociations#2] (initialized)
[junit] DEBUG - Collection found: [com.X.policy.omodel.Rule.conditions#2], was: [com.X.policy.omodel.Rule.conditions#2] (initialized)
[junit] DEBUG - Collection found: [com.X.policy.omodel.Rule.advices#2], was: [com.X.policy.omodel.Rule.advices#2] (initialized)
[junit] DEBUG - Processing unreferenced collections
[junit] DEBUG - Scheduling collection removes/(re)creates/updates
[junit] DEBUG - Flushed: 0 insertions, 0 updates, 0 deletions to 7 objects
[junit] DEBUG - Flushed: 0 (re)creations, 0 updates, 0 removals to 8 collections
[junit] DEBUG - listing entities:
[junit] DEBUG - com.X.policy.omodel.RuleListToRuleAssoc{rule=com.X.policy.omodel.Rule#1, orderIndex=0, ruleList=com.X.policy.omodel.RuleList#2, version=1, ID=2}
[junit] DEBUG - com.X.policy.omodel.RuleList{corporationId=1, ruleAssociations=[com.X.policy.omodel.RuleListToRuleAssoc#3], applicationPointName=Air-Benchmark, name=RuleList1, version=2, ID=1}
[junit] DEBUG - com.X.policy.omodel.RuleListToRuleAssoc{rule=com.X.policy.omodel.Rule#2, orderIndex=1, ruleList=com.X.policy.omodel.RuleList#2, version=1, ID=1}
[junit] DEBUG - com.X.policy.omodel.Rule{active=true, ruleListAssociations=[com.X.policy.omodel.RuleListToRuleAssoc#3, com.X.policy.omodel.RuleListToRuleAssoc#2], advices=[], corporationId=1, applicationPointName=Air-Benchmark, name=Rule1, conditions=[], version=1, ID=1}
[junit] DEBUG - com.X.policy.omodel.RuleListToRuleAssoc{rule=com.X.policy.omodel.Rule#1, orderIndex=0, ruleList=com.X.policy.omodel.RuleList#1, version=1, ID=3}
[junit] DEBUG - com.X.policy.omodel.RuleList{corporationId=1, ruleAssociations=[com.X.policy.omodel.RuleListToRuleAssoc#2, com.X.policy.omodel.RuleListToRuleAssoc#1], applicationPointName=Air-Benchmark, name=RuleList2, version=2, ID=2}
[junit] DEBUG - com.X.policy.omodel.Rule{active=true, ruleListAssociations=[com.X.policy.omodel.RuleListToRuleAssoc#1], advices=[], corporationId=1, applicationPointName=Air-Benchmark, name=Rule2, conditions=[], version=1, ID=2}
[junit] DEBUG - executing flush
[junit] DEBUG - post flush
[junit] DEBUG - closing session
[junit] DEBUG - closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
[junit] DEBUG - returning connection to pool, pool size: 1
[junit] DEBUG - after transaction completion
[junit] DEBUG - after transaction completion
[junit] GETTING RULE 1
[junit] GETTING ASSOCIATIONS
[junit] PULLING RULE LISTS FROM ASSOCS
[junit] MESSING WITH RULE LIST 2
[junit] RL1 : class com.X.policy.omodel.RuleList
[junit] RL1 id: 1
[junit] RL2 : class com.X.policy.omodel.RuleList$$EnhancerByCGLIB$$95235e35
[junit] RL2 id: 2
[junit] RL2 r: [<Rule id="1" active="true" name="Rule1" corporationId="1" applicationPoint="Air-Benchmark"><Conditions></Conditions><Advices></Advices></Rule>,<Rule id="2" active="true" name="Rule2" corporationId="1" applicationPoint="Air-Benchmark"><Conditions></Conditions><Advices></Advices></Rule>]
[junit] ------------- ---------------- ---------------
[junit] Testcase: testRuleToRuleListLazyLoading(com.X.policy.omodel.POMTest): FAILED
[junit] Should have thrown a Hibernate Detached Exception while walking up the tree.
[junit] junit.framework.AssertionFailedError: Should have thrown a Hibernate Detached Exception while walking up the tree.
[junit] at com.X.policy.omodel.POMTest.testRuleToRuleListLazyLoading(POMTest.java:187)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
You can see that RL1 is a RuleList instance, and RL2 is an Enhanced RuleList instance. That's great. It's just that RL2 isn't being treated as a proxy... It's loading up all its data and children, etc etc.
Thank you very much ahead of time for any help. ;)