Hi Steve,
Thanks again for your help.
This is all happening in a unit test that validates that I can secure a child relationship using the filters.
The data gets loaded by the setUp() method. I open a transaction at the beginning of setUp() and commit it at the end (prior to querying the data).
These are some of my configuration properties:
Code:
<property name="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="hibernate.jdbc.batch_size">10</property>
I have tried the left join fetch but it did not help.
Code:
2005-02-09 10:32:58,111 DEBUG SessionImpl.list - find: SELECT blog FROM my.package.domain.Blog blog left join fetch blog.blogEntries
2005-02-09 10:32:58,111 DEBUG QueryParameters.traceParameters - named parameters: {}
2005-02-09 10:32:58,161 DEBUG QueryTranslatorImpl.parse - parse() - HQL: SELECT blog FROM my.package.domain.Blog blog left join fetch blog.blogEntries
2005-02-09 10:32:58,171 DEBUG AST.logAst - --- HQL AST ---
\-'query' [QUERY]
\-'SELECT_FROM' [SELECT_FROM]
+-'FROM' [FROM]
| +-'.' [DOT]
| | +-'.' [DOT]
| | | +-'.' [DOT]
| | | | +-'.' [DOT]
| | | | | +-'com' [IDENT]
| | | | | \-'db' [IDENT]
| | | | \-'persistence' [IDENT]
| | | \-'domain' [IDENT]
| | \-'Blog' [IDENT]
| +-'blog' [ALIAS]
| \-'join' [JOIN]
| +-'left' [LEFT]
| +-'fetch' [FETCH]
| \-'.' [DOT]
| +-'blog' [IDENT]
| \-'blogEntries' [IDENT]
\-'SELECT' [SELECT]
\-'blog' [IDENT]
2005-02-09 10:32:58,271 DEBUG HqlSqlBaseWalker.beforeQuery - query() << begin, level = 1
2005-02-09 10:32:58,281 DEBUG FromElement.doInitialize - my.package.domain.Blog (blog) -> blog0_
2005-02-09 10:32:58,281 DEBUG FromReferenceNode.setResolved - Resolved : blog -> blog0_.id
2005-02-09 10:32:58,291 DEBUG DotNode.getDataType - getDataType() : blogEntries -> org.hibernate.type.SetType@d55986(my.package.domain.Blog.blogEntries)
2005-02-09 10:32:58,291 DEBUG FromElementFactory.createEntityAssociation - createEntityAssociation() : One to many - path = blog.blogEntries role = my.package.domain.Blog.blogEntries associatedEntityName = my.package.domain.BlogEntry
2005-02-09 10:32:58,311 DEBUG FromElement.doInitialize - my.package.domain.BlogEntry (no alias) -> blogentrie1_
2005-02-09 10:32:58,311 DEBUG DotNode.dereferenceCollection - dereferenceCollection() : Created new FROM element for blog.blogEntries : FromElement{<1> tableAlias='blogentrie1_', className='my.package.domain.BlogEntry', classAlias='null', role='my.package.domain.Blog.blogEntries', includeSubclasses=true, collectionJoin=false, fetch=true, origin=FromElement{<0> tableAlias='blog0_', className='my.package.domain.Blog', classAlias='blog', role='null', includeSubclasses=true, collectionJoin=false, fetch=false, origin=null, persister=SingleTableEntityPersister(my.package.domain.Blog), queryableCollection=null, joinSequence=null, columns=null}, persister=SingleTableEntityPersister(my.package.domain.BlogEntry), queryableCollection=OneToManyPersister(my.package.domain.Blog.blogEntries), joinSequence=JoinSequence{->OneToManyPersister(my.package.domain.Blog.blogEntries)[blogentrie1_]}, columns=[blog0_.id]}
2005-02-09 10:32:58,311 DEBUG FromReferenceNode.setResolved - Resolved : blog.blogEntries -> .
2005-02-09 10:32:58,311 DEBUG HqlSqlBaseWalker.afterQuery - query() : finishing up...
2005-02-09 10:32:58,321 DEBUG JoinProcessor.addJoinNodes - Using FROM fragment [blog blog0_]
2005-02-09 10:32:58,321 DEBUG SyntheticAndFactory.addWhereFragment - addWhereFragment() : {and blog0_.id in (select acl.entityId from entity_acl acl where acl.accessLevel >= :hasValidRoles.accessLevel and acl.roleId in (select userRole.roleid from user_roles userRole where userRole.userid = :hasValidRoles.securizedUser))}
2005-02-09 10:32:58,321 DEBUG QueryNode.getWhereClause - getWhereClause() : Creating a new WHERE clause...
2005-02-09 10:32:58,321 DEBUG JoinProcessor.addJoinNodes - Using FROM fragment [left outer join blog_entry blogentrie1_ on blog0_.id=blogentrie1_.blogId and blogentrie1_.id in (select acl.entityId from entity_acl acl where acl.accessLevel >= :blogEntryACLSecurityFilter.accessLevel and acl.roleId in (select userRole.roleid from user_roles userRole where userRole.userid = :blogEntryACLSecurityFilter.currentUserId))]
2005-02-09 10:32:58,321 DEBUG HqlSqlBaseWalker.afterQuery - query() >> end, level = 1
2005-02-09 10:32:58,321 DEBUG AST.logAst - --- SQL AST ---
\-'SELECT' [SELECT] querySpaces (blog_entry,blog)
+-'{select clause}' [SELECT_CLAUSE]
| +-'blog0_.id as id0_' [ALIAS_REF] {alias=blog, className=my.package.domain.Blog, tableAlias=blog0_}
| +-'blogentrie1_.id as id1_' [SELECT_EXPR] {FromElement{className=my.package.domain.BlogEntry,explicit,not a collection join,classAlias=my.package.domain.BlogEntry,tableName=blog_entry,tableAlias=blogentrie1_,colums={blog0_.id }}}
| +-'blog0_.name as name0_0_, blog0_.creationDateTime as creation3_0_0_' [SQL_TOKEN]
| +-'blogentrie1_.content as content1_1_, blogentrie1_.blogId as blogId1_1_' [SQL_TOKEN]
| \-'blogentrie1_.blogId as blogId__, blogentrie1_.id as id__' [SQL_TOKEN]
+-'FROM' [FROM] FromClause{FROM}
| \-'blog blog0_' [FROM_FRAGMENT] FromElement{className=my.package.domain.Blog,explicit,not a collection join,classAlias=blog,tableName=blog,tableAlias=blog0_,colums={}}
| \-'left outer join blog_entry blogentrie1_ on blog0_.id=blogentrie1_.blogId and blogentrie1_.id in (select acl.entityId from entity_acl acl where acl.accessLevel >= :blogEntryACLSecurityFilter.accessLevel and acl.roleId in (select userRole.roleid from user_roles userRole where userRole.userid = :blogEntryACLSecurityFilter.currentUserId))' [JOIN_FRAGMENT] FromElement{className=my.package.domain.BlogEntry,explicit,not a collection join,classAlias=my.package.domain.BlogEntry,tableName=blog_entry,tableAlias=blogentrie1_,colums={blog0_.id }}
\-'WHERE' [WHERE]
\-'blog0_.id in (select acl.entityId from entity_acl acl where acl.accessLevel >= :hasValidRoles.accessLevel and acl.roleId in (select userRole.roleid from user_roles userRole where userRole.userid = :hasValidRoles.securizedUser))' [SQL_TOKEN]
2005-02-09 10:32:58,331 DEBUG QueryTranslatorImpl.generate - HQL: SELECT blog FROM my.package.domain.Blog blog left join fetch blog.blogEntries
2005-02-09 10:32:58,331 DEBUG QueryTranslatorImpl.generate - SQL: select blog0_.id as id0_, blogentrie1_.id as id1_, blog0_.name as name0_0_, blog0_.creationDateTime as creation3_0_0_, blogentrie1_.content as content1_1_, blogentrie1_.blogId as blogId1_1_, blogentrie1_.blogId as blogId__, blogentrie1_.id as id__ from blog blog0_ left outer join blog_entry blogentrie1_ on blog0_.id=blogentrie1_.blogId and blogentrie1_.id in (select acl.entityId from entity_acl acl where acl.accessLevel >= :blogEntryACLSecurityFilter.accessLevel and acl.roleId in (select userRole.roleid from user_roles userRole where userRole.userid = :blogEntryACLSecurityFilter.currentUserId)) where blog0_.id in (select acl.entityId from entity_acl acl where acl.accessLevel >= :hasValidRoles.accessLevel and acl.roleId in (select userRole.roleid from user_roles userRole where userRole.userid = :hasValidRoles.securizedUser))
2005-02-09 10:32:58,341 DEBUG AbstractFlushingEventListener.flushEverythingToExecutions - flushing session
2005-02-09 10:32:58,341 DEBUG Cascades.cascade - processing cascades for: my.package.domain.User
2005-02-09 10:32:58,341 DEBUG Cascades.cascadeCollection - cascading to collection: my.package.domain.User.roles
2005-02-09 10:32:58,341 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,341 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.Role
2005-02-09 10:32:58,341 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,341 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10000717
2005-02-09 10:32:58,341 DEBUG Cascades.cascade - done processing cascades for: my.package.domain.User
2005-02-09 10:32:58,341 DEBUG Cascades.cascade - processing cascades for: my.package.domain.User
2005-02-09 10:32:58,341 DEBUG Cascades.cascadeCollection - cascading to collection: my.package.domain.User.roles
2005-02-09 10:32:58,341 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,341 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.Role
2005-02-09 10:32:58,351 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,351 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10000717
2005-02-09 10:32:58,351 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,351 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.Role
2005-02-09 10:32:58,351 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,351 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10000718
2005-02-09 10:32:58,351 DEBUG Cascades.cascade - done processing cascades for: my.package.domain.User
2005-02-09 10:32:58,351 DEBUG Cascades.cascade - processing cascades for: my.package.domain.User
2005-02-09 10:32:58,351 DEBUG Cascades.cascadeCollection - cascading to collection: my.package.domain.User.roles
2005-02-09 10:32:58,351 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,351 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.Role
2005-02-09 10:32:58,351 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,351 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10000719
2005-02-09 10:32:58,351 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,351 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.Role
2005-02-09 10:32:58,351 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,351 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10000717
2005-02-09 10:32:58,351 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,351 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.Role
2005-02-09 10:32:58,351 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,351 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10000718
2005-02-09 10:32:58,351 DEBUG Cascades.cascade - done processing cascades for: my.package.domain.User
2005-02-09 10:32:58,351 DEBUG Cascades.cascade - processing cascades for: my.package.domain.Blog
2005-02-09 10:32:58,361 DEBUG Cascades.cascadeCollection - cascading to collection: my.package.domain.Blog.blogEntries
2005-02-09 10:32:58,361 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,361 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.BlogEntry
2005-02-09 10:32:58,361 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,361 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10002301
2005-02-09 10:32:58,361 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,361 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.BlogEntry
2005-02-09 10:32:58,361 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,361 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10002302
2005-02-09 10:32:58,361 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,361 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.BlogEntry
2005-02-09 10:32:58,361 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,361 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10002303
2005-02-09 10:32:58,361 DEBUG Cascades.cascade - done processing cascades for: my.package.domain.Blog
2005-02-09 10:32:58,361 DEBUG Cascades.cascade - processing cascades for: my.package.domain.Blog
2005-02-09 10:32:58,361 DEBUG Cascades.cascadeCollection - cascading to collection: my.package.domain.Blog.blogEntries
2005-02-09 10:32:58,361 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,361 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.BlogEntry
2005-02-09 10:32:58,361 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,361 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10002304
2005-02-09 10:32:58,361 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,361 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.BlogEntry
2005-02-09 10:32:58,371 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,371 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10002305
2005-02-09 10:32:58,371 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,371 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.BlogEntry
2005-02-09 10:32:58,371 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,371 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10002306
2005-02-09 10:32:58,371 DEBUG Cascades.cascade - done processing cascades for: my.package.domain.Blog
2005-02-09 10:32:58,371 DEBUG Cascades.cascade - processing cascades for: my.package.domain.Blog
2005-02-09 10:32:58,371 DEBUG Cascades.cascadeCollection - cascading to collection: my.package.domain.Blog.blogEntries
2005-02-09 10:32:58,371 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,371 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.BlogEntry
2005-02-09 10:32:58,371 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,371 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10002307
2005-02-09 10:32:58,371 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,371 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.BlogEntry
2005-02-09 10:32:58,371 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,371 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10002308
2005-02-09 10:32:58,371 DEBUG Cascades.cascade - cascading to saveOrUpdate()
2005-02-09 10:32:58,371 DEBUG AbstractSaveEventListener.getEntityState - persistent instance of: my.package.domain.BlogEntry
2005-02-09 10:32:58,371 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - ignoring persistent instance
2005-02-09 10:32:58,371 DEBUG DefaultSaveOrUpdateEventListener.entityIsPersistent - object already associated with session with id: 10002309
2005-02-09 10:32:58,371 DEBUG Cascades.cascade - done processing cascades for: my.package.domain.Blog
2005-02-09 10:32:58,381 DEBUG AbstractFlushingEventListener.flushEntities - Flushing entities and processing referenced collections
2005-02-09 10:32:58,381 DEBUG Collections.updateReachableCollection - Collection found: [my.package.domain.User.roles#10000758], was: [my.package.domain.User.roles#10000758] (initialized)
2005-02-09 10:32:58,381 DEBUG Collections.updateReachableCollection - Collection found: [my.package.domain.User.roles#10000759], was: [my.package.domain.User.roles#10000759] (initialized)
2005-02-09 10:32:58,381 DEBUG Collections.updateReachableCollection - Collection found: [my.package.domain.User.roles#10000760], was: [my.package.domain.User.roles#10000760] (initialized)
2005-02-09 10:32:58,381 DEBUG Collections.updateReachableCollection - Collection found: [my.package.domain.Blog.blogEntries#10001018], was: [my.package.domain.Blog.blogEntries#10001018] (initialized)
2005-02-09 10:32:58,381 DEBUG Collections.updateReachableCollection - Collection found: [my.package.domain.Blog.blogEntries#10001019], was: [my.package.domain.Blog.blogEntries#10001019] (initialized)
2005-02-09 10:32:58,381 DEBUG Collections.updateReachableCollection - Collection found: [my.package.domain.Blog.blogEntries#10001020], was: [my.package.domain.Blog.blogEntries#10001020] (initialized)
2005-02-09 10:32:58,381 DEBUG AbstractFlushingEventListener.flushCollections - Processing unreferenced collections
2005-02-09 10:32:58,381 DEBUG AbstractFlushingEventListener.flushCollections - Scheduling collection removes/(re)creates/updates
2005-02-09 10:32:58,381 DEBUG AbstractFlushingEventListener.flushEverythingToExecutions - Flushed: 0 insertions, 0 updates, 0 deletions to 26 objects
2005-02-09 10:32:58,381 DEBUG AbstractFlushingEventListener.flushEverythingToExecutions - Flushed: 0 (re)creations, 0 updates, 0 removals to 6 collections
2005-02-09 10:32:58,381 DEBUG Printer.toString - listing entities:
2005-02-09 10:32:58,381 DEBUG Printer.toString - my.package.domain.Blog{creationdatetime=2005-02-09 10:32:57, name=allAccessBlog, id=10001018, blogEntries=[my.package.domain.BlogEntry#10002301, my.package.domain.BlogEntry#10002302, my.package.domain.BlogEntry#10002303]}
2005-02-09 10:32:58,381 DEBUG Printer.toString - my.package.domain.User{userName=Mike, userid=10000759, userLastName=Director, roles=[my.package.domain.Role#10000717, my.package.domain.Role#10000718], birthDate=1968-01-02 00:09:00}
2005-02-09 10:32:58,381 DEBUG Printer.toString - my.package.entitlement.EntityAcl{accessLevel=1, roleId=10000717, entityType=my.package.domain.BlogEntry, id=3136633892082026361, entityId=10002303}
2005-02-09 10:32:58,381 DEBUG Printer.toString - my.package.domain.BlogEntry{text=Sensitive information about Q4 earnings, blog=my.package.domain.Blog#10001019, id=10002306}
2005-02-09 10:32:58,381 DEBUG Printer.toString - my.package.entitlement.EntityAcl{accessLevel=2, roleId=10000719, entityType=my.package.domain.Blog, id=3136633892082026359, entityId=10001018}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.domain.BlogEntry{text=Top Secret information about planned merger, blog=my.package.domain.Blog#10001020, id=10002307}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.domain.Role{rolename=readTopSecretLevelInformation, roleid=10000719}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.domain.BlogEntry{text=Sensitive information about employees' salaries, blog=my.package.domain.Blog#10001019, id=10002304}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.domain.BlogEntry{text=Useless information about company values, blog=my.package.domain.Blog#10001018, id=10002303}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.domain.Blog{creationdatetime=2005-02-09 10:32:57, name=topSecretBlog, id=10001020, blogEntries=[my.package.domain.BlogEntry#10002307, my.package.domain.BlogEntry#10002308, my.package.domain.BlogEntry#10002309]}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.entitlement.EntityAcl{accessLevel=1, roleId=10000719, entityType=my.package.domain.Blog, id=3136633892082026357, entityId=10001020}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.domain.BlogEntry{text=Top Secret information about accounting frauds, blog=my.package.domain.Blog#10001020, id=10002309}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.domain.Blog{creationdatetime=2005-02-09 10:32:57, name=sensitiveBlog, id=10001019, blogEntries=[my.package.domain.BlogEntry#10002304, my.package.domain.BlogEntry#10002305, my.package.domain.BlogEntry#10002306]}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.domain.User{userName=Joe, userid=10000758, userLastName=Apprentice, roles=[my.package.domain.Role#10000717], birthDate=1980-01-09 00:04:00}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.entitlement.EntityAcl{accessLevel=1, roleId=10000717, entityType=my.package.domain.Blog, id=3136633892082026360, entityId=10001018}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.entitlement.EntityAcl{accessLevel=1, roleId=10000717, entityType=my.package.domain.BlogEntry, id=3136633892082026362, entityId=10002302}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.entitlement.EntityAcl{accessLevel=1, roleId=10000719, entityType=my.package.domain.Blog, id=3136633892082026356, entityId=10001019}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.domain.BlogEntry{text=Company contact information, blog=my.package.domain.Blog#10001018, id=10002301}
2005-02-09 10:32:58,391 DEBUG Printer.toString - my.package.domain.User{userName=Donald, userid=10000760, userLastName=Trump, roles=[my.package.domain.Role#10000719, my.package.domain.Role#10000717, my.package.domain.Role#10000718], birthDate=1953-01-05 00:01:00}
2005-02-09 10:32:58,421 DEBUG Printer.toString - my.package.entitlement.EntityAcl{accessLevel=1, roleId=10000718, entityType=my.package.domain.Blog, id=3136633892082026355, entityId=10001019}
2005-02-09 10:32:58,421 DEBUG Printer.toString - my.package.domain.BlogEntry{text=Top Secret about future IPO, blog=my.package.domain.Blog#10001020, id=10002308}
2005-02-09 10:32:58,441 DEBUG Printer.toString - more......
2005-02-09 10:32:58,441 DEBUG DefaultAutoFlushEventListener.onAutoFlush - Dont need to execute flush
2005-02-09 10:32:58,441 DEBUG AbstractBatcher.logOpenPreparedStatement - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2005-02-09 10:32:58,441 DEBUG SQL.log - select blog0_.id as id0_, blogentrie1_.id as id1_, blog0_.name as name0_0_, blog0_.creationDateTime as creation3_0_0_, blogentrie1_.content as content1_1_, blogentrie1_.blogId as blogId1_1_, blogentrie1_.blogId as blogId__, blogentrie1_.id as id__ from blog blog0_ left outer join blog_entry blogentrie1_ on blog0_.id=blogentrie1_.blogId and blogentrie1_.id in (select acl.entityId from entity_acl acl where acl.accessLevel >= ? and acl.roleId in (select userRole.roleid from user_roles userRole where userRole.userid = ?)) where blog0_.id in (select acl.entityId from entity_acl acl where acl.accessLevel >= ? and acl.roleId in (select userRole.roleid from user_roles userRole where userRole.userid = ?))
Hibernate: select blog0_.id as id0_, blogentrie1_.id as id1_, blog0_.name as name0_0_, blog0_.creationDateTime as creation3_0_0_, blogentrie1_.content as content1_1_, blogentrie1_.blogId as blogId1_1_, blogentrie1_.blogId as blogId__, blogentrie1_.id as id__ from blog blog0_ left outer join blog_entry blogentrie1_ on blog0_.id=blogentrie1_.blogId and blogentrie1_.id in (select acl.entityId from entity_acl acl where acl.accessLevel >= ? and acl.roleId in (select userRole.roleid from user_roles userRole where userRole.userid = ?)) where blog0_.id in (select acl.entityId from entity_acl acl where acl.accessLevel >= ? and acl.roleId in (select userRole.roleid from user_roles userRole where userRole.userid = ?))
2005-02-09 10:32:58,441 DEBUG AbstractBatcher.getPreparedStatement - preparing statement
2005-02-09 10:32:58,441 DEBUG ByteType.nullSafeSet - binding '1' to parameter: 1
2005-02-09 10:32:58,441 DEBUG LongType.nullSafeSet - binding '10000758' to parameter: 2
2005-02-09 10:32:58,441 DEBUG ByteType.nullSafeSet - binding '1' to parameter: 3
2005-02-09 10:32:58,441 DEBUG LongType.nullSafeSet - binding '10000758' to parameter: 4
2005-02-09 10:32:58,782 DEBUG AbstractBatcher.logOpenResults - about to open ResultSet (open ResultSets: 0, globally: 0)
2005-02-09 10:32:58,782 DEBUG Loader.wrapResultSetIfEnabled - Using naked result set
2005-02-09 10:32:58,782 DEBUG Loader.doQuery - processing result set
2005-02-09 10:32:58,782 DEBUG Loader.doQuery - result set row: 0
2005-02-09 10:32:58,782 DEBUG LongType.nullSafeGet - returning '10001018' as column: id0_
2005-02-09 10:32:58,782 DEBUG LongType.nullSafeGet - returning '10002302' as column: id1_
2005-02-09 10:32:58,782 DEBUG Loader.getRow - result row: EntityKey[my.package.domain.Blog#10001018], EntityKey[my.package.domain.BlogEntry#10002302]
2005-02-09 10:32:58,792 DEBUG Loader.doQuery - result set row: 1
2005-02-09 10:32:58,792 DEBUG LongType.nullSafeGet - returning '10001018' as column: id0_
2005-02-09 10:32:58,792 DEBUG LongType.nullSafeGet - returning '10002303' as column: id1_
2005-02-09 10:32:58,792 DEBUG Loader.getRow - result row: EntityKey[my.package.domain.Blog#10001018], EntityKey[my.package.domain.BlogEntry#10002303]
2005-02-09 10:32:58,792 DEBUG Loader.doQuery - done processing result set (2 rows)
2005-02-09 10:32:58,792 DEBUG AbstractBatcher.logCloseResults - about to close ResultSet (open ResultSets: 1, globally: 1)
2005-02-09 10:32:58,792 DEBUG AbstractBatcher.logClosePreparedStatement - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2005-02-09 10:32:58,792 DEBUG AbstractBatcher.closePreparedStatement - closing statement
2005-02-09 10:32:58,792 DEBUG Loader.initializeEntitiesAndCollections - total objects hydrated: 0
2005-02-09 10:32:58,792 DEBUG PersistenceContext.initializeNonLazyCollections - initializing non-lazy collections
2005-02-09 10:32:58,792 DEBUG SessionImpl.close - closing session
2005-02-09 10:32:58,792 DEBUG SessionImpl.disconnect - disconnecting session
2005-02-09 10:32:58,792 DEBUG AbstractBatcher.closeConnection - closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
2005-02-09 10:32:58,802 DEBUG DriverManagerConnectionProvider.closeConnection - returning connection to pool, pool size: 1
2005-02-09 10:32:58,802 DEBUG SessionImpl.afterTransactionCompletion - after transaction completion
If your require it, I can try to set up another test (because this one is meant to test my infrastructure and posting it would be quite complex).
Thanks again,