I am using version 2.1.1. I have been using Hibernate for about two months. This is not really a problem, just a question about the amount of data returned in a criteria query.
********************************************************
The mapping documents:
********************************************************
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping package="com.cds.icp.agencydataentry.hibernate">
<class name="User" table="Agency.USER" dynamic-update="true" select-before-update="true">
<id name="userId" column="User_ID" unsaved-value="0">
<generator class="identity" />
</id>
<timestamp
name="lastUpdatedDateTime"
column="Last_Updated_Tstamp"/>
<property
name="activeFlag"
column="Active_ind" />
<property
name="firstName"
column="First_Name" />
<property
name="lastName"
column="Last_Name" />
<property
name="middleInitial"
column="Email_addr" />
<property
name="userName"
column="User_Name" />
<property
name="emailAddress"
column="Email_Addr" />
<property
name="lastUpdatedByUserId"
column="Last_Updated_User_ID"/>
<set
name="passwords"
inverse="true"
cascade="all-delete-orphan">
<key
column="User_ID"/>
<one-to-many
class="Password"/>
</set>
<one-to-one
name="groupDetail"
class="GroupDetail"
property-ref="userId"
cascade="all"/>
<one-to-one
name="userAgency"
class="UserAgency"
property-ref="userId"/>
</class>
</hibernate-mapping>
***************************************
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping
package="com.cds.icp.agencydataentry.hibernate">
<class
name="Password"
table="Agency.PASSWORD">
<id
name="passwordId"
column="Password_ID"
unsaved-value="0">
<generator
class="identity" />
</id>
<property
name="activeFlag"
column="Active_ind" />
<property
name="password"
column="Password" />
<property
name="createdDateTime"
insert="false"
update="false"
column="Created_Tstamp" />
<property
name="createdByUserId"
column="Created_User_ID" />
<many-to-one
name="user"
class="User"
column="User_Id"
not-null="true"/>
</class>
</hibernate-mapping>
*********************************************************
The code:
*********************************************************
public static User GetUserByUserName(String findName) throws HibernateException {
List users = null;
User aUser = null;
try {
Session hibernateSession = HibernateUtils.currentSession();
Criteria criteria = hibernateSession.createCriteria(User.class);
criteria.add(Expression.eq("userName", findName.trim()));
users = (List) criteria.list();
if (users.size() != 0) {
aUser = (User) users.get(0);
aUser.getPasswords();
}
} catch (HibernateException e) {
logger.fatal("HIBERNATE EXCEPTION: " + e);
throw e;
} finally {
HibernateUtils.closeSession();
}
return aUser;
****************************************************
The Console Log:
****************************************************
DEBUG GetUserByUserName.Start - 13:17:16,668 UserDAO:71
DEBUG opened session - 13:17:17,089 SessionImpl:528
DEBUG find by criteria: [net.sf.hibernate.impl.CriteriaImpl$CriterionEntry@602681d4] - 13:17:17,230 SessionImpl:3431
DEBUG flushing session - 13:17:17,293 SessionImpl:2193
DEBUG Flushing entities and processing referenced collections - 13:17:17,308 SessionImpl:2321
DEBUG Processing unreferenced collections - 13:17:17,339 SessionImpl:2664
DEBUG Scheduling collection removes/(re)creates/updates - 13:17:17,371 SessionImpl:2678
DEBUG Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects - 13:17:17,386 SessionImpl:2217
DEBUG Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections - 13:17:17,433 SessionImpl:2222
DEBUG Dont need to execute flush - 13:17:17,464 SessionImpl:1745
DEBUG about to open: 0 open PreparedStatements, 0 open ResultSets - 13:17:17,527 BatcherImpl:192
DEBUG total checked-out connections: 0 - 13:17:17,558 DriverManagerConnectionProvider:78
DEBUG using pooled JDBC connection, pool size: 0 - 13:17:17,589 DriverManagerConnectionProvider:84
DEBUG select this.User_ID as User_ID5_, this.Last_Updated_Tstamp as Last_Upd2_5_, this.Active_ind as Active_ind5_, this.First_Name as First_Name5_, this.Last_Name as Last_Name5_, this.Email_addr as Email_addr5_, this.User_Name as User_Name5_, this.Email_Addr as Email_Addr5_, this.Last_Updated_User_ID as Last_Upd9_5_, groupdetai1_.Group_Detail_ID as Group_De1_0_, groupdetai1_.User_Id as User_Id0_, groupdetai1_.User_Group_ID as User_Gro3_0_, usergroup2_.User_Group_ID as User_Gro1_1_, usergroup2_.group_name as group_name1_, usergroup2_.Password_Valid_Days as Password3_1_, useragency3_.User_Agency_ID as User_Age1_2_, useragency3_.User_Id as User_Id2_, useragency3_.Agency_Id as Agency_Id2_, agency4_.Agency_ID as Agency_ID3_, agency4_.Last_Updated_Tstamp as Last_Upd2_3_, agency4_.Agency_Abbr as Agency_A3_3_, agency4_.Name as Name3_, agency4_.Days_To_Save_Trans as Days_To_5_3_, agency4_.Save_Deleted_Trans as Save_Del6_3_, agency4_.Admin_User_id as Admin_Us7_3_, agency4_.Active_cd as Active_cd3_, agency4_.Last_Updated_User_ID as Last_Upd9_3_, agency4_.NameAddress_Id as NameAdd10_3_, nameaddres5_.NameAddress_Id as NameAddr1_4_, nameaddres5_.Last_Updated_Tstamp as Last_Upd2_4_, nameaddres5_.Name as Name4_, nameaddres5_.Addr_Line_1 as Addr_Lin4_4_, nameaddres5_.Addr_Line_2 as Addr_Lin5_4_, nameaddres5_.City as City4_, nameaddres5_.State_Province_cd as State_Pr7_4_, nameaddres5_.Postal_Delivery_Cd as Postal_D8_4_, nameaddres5_.Phone_Number as Phone_Nu9_4_, nameaddres5_.Email_Addr as Email_Addr4_, nameaddres5_.Last_Updated_User_ID as Last_Up11_4_ from Agency.USER this left outer join Agency.GROUP_DETAIL groupdetai1_ on this.User_ID=groupdetai1_.User_Id left outer join Agency.USER_GROUP usergroup2_ on groupdetai1_.User_Group_ID=usergroup2_.User_Group_ID left outer join Agency.USER_AGENCY useragency3_ on this.User_ID=useragency3_.User_Id left outer join Agency.AGENCY agency4_ on useragency3_.Agency_Id=agency4_.Agency_ID left outer join Agency.NAMEADDRESS nameaddres5_ on agency4_.NameAddress_Id=nameaddres5_.NameAddress_Id where this.User_Name=? - 13:17:17,621 SQL:223
Hibernate: select this.User_ID as User_ID5_, this.Last_Updated_Tstamp as Last_Upd2_5_, this.Active_ind as Active_ind5_, this.First_Name as First_Name5_, this.Last_Name as Last_Name5_, this.Email_addr as Email_addr5_, this.User_Name as User_Name5_, this.Email_Addr as Email_Addr5_, this.Last_Updated_User_ID as Last_Upd9_5_, groupdetai1_.Group_Detail_ID as Group_De1_0_, groupdetai1_.User_Id as User_Id0_, groupdetai1_.User_Group_ID as User_Gro3_0_, usergroup2_.User_Group_ID as User_Gro1_1_, usergroup2_.group_name as group_name1_, usergroup2_.Password_Valid_Days as Password3_1_, useragency3_.User_Agency_ID as User_Age1_2_, useragency3_.User_Id as User_Id2_, useragency3_.Agency_Id as Agency_Id2_, agency4_.Agency_ID as Agency_ID3_, agency4_.Last_Updated_Tstamp as Last_Upd2_3_, agency4_.Agency_Abbr as Agency_A3_3_, agency4_.Name as Name3_, agency4_.Days_To_Save_Trans as Days_To_5_3_, agency4_.Save_Deleted_Trans as Save_Del6_3_, agency4_.Admin_User_id as Admin_Us7_3_, agency4_.Active_cd as Active_cd3_, agency4_.Last_Updated_User_ID as Last_Upd9_3_, agency4_.NameAddress_Id as NameAdd10_3_, nameaddres5_.NameAddress_Id as NameAddr1_4_, nameaddres5_.Last_Updated_Tstamp as Last_Upd2_4_, nameaddres5_.Name as Name4_, nameaddres5_.Addr_Line_1 as Addr_Lin4_4_, nameaddres5_.Addr_Line_2 as Addr_Lin5_4_, nameaddres5_.City as City4_, nameaddres5_.State_Province_cd as State_Pr7_4_, nameaddres5_.Postal_Delivery_Cd as Postal_D8_4_, nameaddres5_.Phone_Number as Phone_Nu9_4_, nameaddres5_.Email_Addr as Email_Addr4_, nameaddres5_.Last_Updated_User_ID as Last_Up11_4_ from Agency.USER this left outer join Agency.GROUP_DETAIL groupdetai1_ on this.User_ID=groupdetai1_.User_Id left outer join Agency.USER_GROUP usergroup2_ on groupdetai1_.User_Group_ID=usergroup2_.User_Group_ID left outer join Agency.USER_AGENCY useragency3_ on this.User_ID=useragency3_.User_Id left outer join Agency.AGENCY agency4_ on useragency3_.Agency_Id=agency4_.Agency_ID left outer join Agency.NAMEADDRESS nameaddres5_ on agency4_.NameAddress_Id=nameaddres5_.NameAddress_Id where this.User_Name=?
DEBUG preparing statement - 13:17:17,652 BatcherImpl:227
DEBUG binding 'john' to parameter: 1 - 13:17:17,871 StringType:46
DEBUG processing result set - 13:17:17,964 Loader:196
DEBUG returning '1' as column: Group_De1_0_ - 13:17:18,058 IntegerType:68
DEBUG returning '2' as column: User_Gro1_1_ - 13:17:18,089 IntegerType:68
DEBUG returning '1' as column: User_Age1_2_ - 13:17:18,121 IntegerType:68
DEBUG returning '1' as column: Agency_ID3_ - 13:17:18,152 IntegerType:68
DEBUG returning '1' as column: NameAddr1_4_ - 13:17:18,183 IntegerType:68
DEBUG returning '1' as column: User_ID5_ - 13:17:18,214 IntegerType:68
DEBUG result row: 1, 2, 1, 1, 1, 1 - 13:17:18,246 Loader:404
DEBUG Initializing object from ResultSet: 1 - 13:17:18,277 Loader:535
DEBUG Hydrating entity: com.cds.icp.agencydataentry.hibernate.GroupDetail#1 - 13:17:18,324 Loader:604
DEBUG returning '1' as column: User_Id0_ - 13:17:18,355 IntegerType:68
DEBUG returning '2' as column: User_Gro3_0_ - 13:17:18,386 IntegerType:68
DEBUG Initializing object from ResultSet: 2 - 13:17:18,433 Loader:535
DEBUG Hydrating entity: com.cds.icp.agencydataentry.hibernate.UserGroup#2 - 13:17:18,464 Loader:604
DEBUG returning 'Agency Administrator ' as column: group_name1_ - 13:17:18,496 StringType:68
DEBUG returning '30' as column: Password3_1_ - 13:17:18,542 IntegerType:68
DEBUG Initializing object from ResultSet: 1 - 13:17:18,574 Loader:535
DEBUG Hydrating entity: com.cds.icp.agencydataentry.hibernate.UserAgency#1 - 13:17:18,605 Loader:604
DEBUG returning '1' as column: User_Id2_ - 13:17:18,636 IntegerType:68
DEBUG returning '1' as column: Agency_Id2_ - 13:17:18,667 IntegerType:68
DEBUG Initializing object from ResultSet: 1 - 13:17:18,699 Loader:535
DEBUG Hydrating entity: com.cds.icp.agencydataentry.hibernate.Agency#1 - 13:17:18,730 Loader:604
DEBUG returning '27 May 2004 11:00:00' as column: Last_Upd2_3_ - 13:17:18,839 TimestampType:68
DEBUG returning 'JTB' as column: Agency_A3_3_ - 13:17:18,886 StringType:68
DEBUG returning 'Johns Test Agency ' as column: Name3_ - 13:17:18,917 StringType:68
DEBUG returning '90' as column: Days_To_5_3_ - 13:17:18,949 IntegerType:68
DEBUG returning 'Y' as column: Save_Del6_3_ - 13:17:18,980 StringType:68
DEBUG returning '1' as column: Admin_Us7_3_ - 13:17:19,027 IntegerType:68
DEBUG returning 'Y' as column: Active_cd3_ - 13:17:19,058 StringType:68
DEBUG returning '1' as column: Last_Upd9_3_ - 13:17:19,089 IntegerType:68
DEBUG returning '1' as column: NameAdd10_3_ - 13:17:19,121 IntegerType:68
DEBUG Version: 2004-05-27 11:00:00.304 - 13:17:19,167 SessionImpl:1837
DEBUG Initializing object from ResultSet: 1 - 13:17:19,199 Loader:535
DEBUG Hydrating entity: com.cds.icp.agencydataentry.hibernate.NameAddress#1 - 13:17:19,230 Loader:604
DEBUG returning '16 June 2004 09:28:36' as column: Last_Upd2_4_ - 13:17:19,261 TimestampType:68
DEBUG returning 'John T Bush ' as column: Name4_ - 13:17:19,292 StringType:68
DEBUG returning '123 Anytown ' as column: Addr_Lin4_4_ - 13:17:19,339 StringType:68
DEBUG returning null as column: Addr_Lin5_4_ - 13:17:19,371 StringType:64
DEBUG returning 'Des Moines ' as column: City4_ - 13:17:19,402 StringType:68
DEBUG returning 'IA' as column: State_Pr7_4_ - 13:17:19,433 StringType:68
DEBUG returning '50315 ' as column: Postal_D8_4_ - 13:17:19,480 StringType:68
DEBUG returning ' ' as column: Phone_Nu9_4_ - 13:17:19,511 StringType:68
DEBUG returning 'none ' as column: Email_Addr4_ - 13:17:19,558 StringType:68
DEBUG returning '1' as column: Last_Up11_4_ - 13:17:19,589 IntegerType:68
DEBUG Version: 2004-06-16 09:28:36.273 - 13:17:19,636 SessionImpl:1837
DEBUG Initializing object from ResultSet: 1 - 13:17:19,667 Loader:535
DEBUG Hydrating entity: com.cds.icp.agencydataentry.hibernate.User#1 - 13:17:19,699 Loader:604
DEBUG returning '15 June 2004 09:04:26' as column: Last_Upd2_5_ - 13:17:19,730 TimestampType:68
DEBUG returning 'Y' as column: Active_ind5_ - 13:17:19,761 StringType:68
DEBUG returning 'John ' as column: First_Name5_ - 13:17:19,808 StringType:68
DEBUG returning 'Bush ' as column: Last_Name5_ - 13:17:19,839 StringType:68
DEBUG returning null as column: Email_addr5_ - 13:17:19,871 StringType:64
DEBUG returning 'john ' as column: User_Name5_ - 13:17:19,902 StringType:68
DEBUG returning null as column: Email_Addr5_ - 13:17:19,933 StringType:64
DEBUG returning '1' as column: Last_Upd9_5_ - 13:17:19,980 IntegerType:68
DEBUG Version: 2004-06-15 09:04:26.742 - 13:17:20,011 SessionImpl:1837
DEBUG done processing result set (1 rows) - 13:17:20,042 Loader:225
DEBUG done closing: 0 open PreparedStatements, 0 open ResultSets - 13:17:20,089 BatcherImpl:199
DEBUG closing statement - 13:17:20,121 BatcherImpl:240
DEBUG total objects hydrated: 6 - 13:17:20,167 Loader:238
DEBUG resolving associations for [com.cds.icp.agencydataentry.hibernate.GroupDetail#1] - 13:17:20,199 SessionImpl:2129
DEBUG loading [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:20,230 SessionImpl:1913
DEBUG attempting to resolve [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:20,261 SessionImpl:2010
DEBUG resolved object in session cache [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:20,292 SessionImpl:2026
DEBUG loading [com.cds.icp.agencydataentry.hibernate.UserGroup#2] - 13:17:20,339 SessionImpl:1913
DEBUG attempting to resolve [com.cds.icp.agencydataentry.hibernate.UserGroup#2] - 13:17:20,371 SessionImpl:2010
DEBUG resolved object in session cache [com.cds.icp.agencydataentry.hibernate.UserGroup#2] - 13:17:20,402 SessionImpl:2026
DEBUG done materializing entity [com.cds.icp.agencydataentry.hibernate.GroupDetail#1] - 13:17:20,433 SessionImpl:2153
DEBUG resolving associations for [com.cds.icp.agencydataentry.hibernate.UserGroup#2] - 13:17:20,464 SessionImpl:2129
DEBUG done materializing entity [com.cds.icp.agencydataentry.hibernate.UserGroup#2] - 13:17:20,496 SessionImpl:2153
DEBUG resolving associations for [com.cds.icp.agencydataentry.hibernate.UserAgency#1] - 13:17:20,511 SessionImpl:2129
DEBUG loading [com.cds.icp.agencydataentry.hibernate.Agency#1] - 13:17:20,542 SessionImpl:1913
DEBUG attempting to resolve [com.cds.icp.agencydataentry.hibernate.Agency#1] - 13:17:20,574 SessionImpl:2010
DEBUG resolved object in session cache [com.cds.icp.agencydataentry.hibernate.Agency#1] - 13:17:20,605 SessionImpl:2026
DEBUG done materializing entity [com.cds.icp.agencydataentry.hibernate.UserAgency#1] - 13:17:20,652 SessionImpl:2153
DEBUG resolving associations for [com.cds.icp.agencydataentry.hibernate.Agency#1] - 13:17:20,667 SessionImpl:2129
DEBUG loading [com.cds.icp.agencydataentry.hibernate.NameAddress#1] - 13:17:20,699 SessionImpl:1913
DEBUG attempting to resolve [com.cds.icp.agencydataentry.hibernate.NameAddress#1] - 13:17:20,730 SessionImpl:2010
DEBUG resolved object in session cache [com.cds.icp.agencydataentry.hibernate.NameAddress#1] - 13:17:20,761 SessionImpl:2026
DEBUG done materializing entity [com.cds.icp.agencydataentry.hibernate.Agency#1] - 13:17:20,808 SessionImpl:2153
DEBUG resolving associations for [com.cds.icp.agencydataentry.hibernate.NameAddress#1] - 13:17:20,824 SessionImpl:2129
DEBUG done materializing entity [com.cds.icp.agencydataentry.hibernate.NameAddress#1] - 13:17:20,855 SessionImpl:2153
DEBUG resolving associations for [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:20,886 SessionImpl:2129
DEBUG collection not cached - 13:17:20,933 SessionImpl:3746
DEBUG about to open: 0 open PreparedStatements, 0 open ResultSets - 13:17:21,011 BatcherImpl:192
DEBUG select groupdetai0_.Group_Detail_ID as Group_De1_4_, groupdetai0_.User_Id as User_Id4_, groupdetai0_.User_Group_ID as User_Gro3_4_, user1_.User_ID as User_ID0_, user1_.Last_Updated_Tstamp as Last_Upd2_0_, user1_.Active_ind as Active_ind0_, user1_.First_Name as First_Name0_, user1_.Last_Name as Last_Name0_, user1_.Email_addr as Email_addr0_, user1_.User_Name as User_Name0_, user1_.Email_Addr as Email_Addr0_, user1_.Last_Updated_User_ID as Last_Upd9_0_, useragency2_.User_Agency_ID as User_Age1_1_, useragency2_.User_Id as User_Id1_, useragency2_.Agency_Id as Agency_Id1_, agency3_.Agency_ID as Agency_ID2_, agency3_.Last_Updated_Tstamp as Last_Upd2_2_, agency3_.Agency_Abbr as Agency_A3_2_, agency3_.Name as Name2_, agency3_.Days_To_Save_Trans as Days_To_5_2_, agency3_.Save_Deleted_Trans as Save_Del6_2_, agency3_.Admin_User_id as Admin_Us7_2_, agency3_.Active_cd as Active_cd2_, agency3_.Last_Updated_User_ID as Last_Upd9_2_, agency3_.NameAddress_Id as NameAdd10_2_, usergroup4_.User_Group_ID as User_Gro1_3_, usergroup4_.group_name as group_name3_, usergroup4_.Password_Valid_Days as Password3_3_ from Agency.GROUP_DETAIL groupdetai0_ left outer join Agency.USER user1_ on groupdetai0_.Group_Detail_ID=user1_.User_ID left outer join Agency.USER_AGENCY useragency2_ on user1_.User_ID=useragency2_.User_Id left outer join Agency.AGENCY agency3_ on useragency2_.Agency_Id=agency3_.Agency_ID left outer join Agency.USER_GROUP usergroup4_ on groupdetai0_.User_Group_ID=usergroup4_.User_Group_ID where groupdetai0_.User_Id=? - 13:17:21,058 SQL:223
Hibernate: select groupdetai0_.Group_Detail_ID as Group_De1_4_, groupdetai0_.User_Id as User_Id4_, groupdetai0_.User_Group_ID as User_Gro3_4_, user1_.User_ID as User_ID0_, user1_.Last_Updated_Tstamp as Last_Upd2_0_, user1_.Active_ind as Active_ind0_, user1_.First_Name as First_Name0_, user1_.Last_Name as Last_Name0_, user1_.Email_addr as Email_addr0_, user1_.User_Name as User_Name0_, user1_.Email_Addr as Email_Addr0_, user1_.Last_Updated_User_ID as Last_Upd9_0_, useragency2_.User_Agency_ID as User_Age1_1_, useragency2_.User_Id as User_Id1_, useragency2_.Agency_Id as Agency_Id1_, agency3_.Agency_ID as Agency_ID2_, agency3_.Last_Updated_Tstamp as Last_Upd2_2_, agency3_.Agency_Abbr as Agency_A3_2_, agency3_.Name as Name2_, agency3_.Days_To_Save_Trans as Days_To_5_2_, agency3_.Save_Deleted_Trans as Save_Del6_2_, agency3_.Admin_User_id as Admin_Us7_2_, agency3_.Active_cd as Active_cd2_, agency3_.Last_Updated_User_ID as Last_Upd9_2_, agency3_.NameAddress_Id as NameAdd10_2_, usergroup4_.User_Group_ID as User_Gro1_3_, usergroup4_.group_name as group_name3_, usergroup4_.Password_Valid_Days as Password3_3_ from Agency.GROUP_DETAIL groupdetai0_ left outer join Agency.USER user1_ on groupdetai0_.Group_Detail_ID=user1_.User_ID left outer join Agency.USER_AGENCY useragency2_ on user1_.User_ID=useragency2_.User_Id left outer join Agency.AGENCY agency3_ on useragency2_.Agency_Id=agency3_.Agency_ID left outer join Agency.USER_GROUP usergroup4_ on groupdetai0_.User_Group_ID=usergroup4_.User_Group_ID where groupdetai0_.User_Id=?
DEBUG preparing statement - 13:17:21,105 BatcherImpl:227
DEBUG binding '1' to parameter: 1 - 13:17:21,136 IntegerType:46
DEBUG processing result set - 13:17:21,183 Loader:196
DEBUG returning '1' as column: User_ID0_ - 13:17:21,230 IntegerType:68
DEBUG returning '1' as column: User_Age1_1_ - 13:17:21,261 IntegerType:68
DEBUG returning '1' as column: Agency_ID2_ - 13:17:21,308 IntegerType:68
DEBUG returning '2' as column: User_Gro1_3_ - 13:17:21,355 IntegerType:68
DEBUG returning '1' as column: Group_De1_4_ - 13:17:21,386 IntegerType:68
DEBUG result row: 1, 1, 1, 2, 1 - 13:17:21,433 Loader:404
DEBUG done processing result set (1 rows) - 13:17:21,480 Loader:225
DEBUG done closing: 0 open PreparedStatements, 0 open ResultSets - 13:17:21,511 BatcherImpl:199
DEBUG closing statement - 13:17:21,558 BatcherImpl:240
DEBUG total objects hydrated: 0 - 13:17:21,589 Loader:238
DEBUG about to open: 0 open PreparedStatements, 0 open ResultSets - 13:17:21,652 BatcherImpl:192
DEBUG select useragency0_.User_Agency_ID as User_Age1_2_, useragency0_.User_Id as User_Id2_, useragency0_.Agency_Id as Agency_Id2_, agency1_.Agency_ID as Agency_ID0_, agency1_.Last_Updated_Tstamp as Last_Upd2_0_, agency1_.Agency_Abbr as Agency_A3_0_, agency1_.Name as Name0_, agency1_.Days_To_Save_Trans as Days_To_5_0_, agency1_.Save_Deleted_Trans as Save_Del6_0_, agency1_.Admin_User_id as Admin_Us7_0_, agency1_.Active_cd as Active_cd0_, agency1_.Last_Updated_User_ID as Last_Upd9_0_, agency1_.NameAddress_Id as NameAdd10_0_, nameaddres2_.NameAddress_Id as NameAddr1_1_, nameaddres2_.Last_Updated_Tstamp as Last_Upd2_1_, nameaddres2_.Name as Name1_, nameaddres2_.Addr_Line_1 as Addr_Lin4_1_, nameaddres2_.Addr_Line_2 as Addr_Lin5_1_, nameaddres2_.City as City1_, nameaddres2_.State_Province_cd as State_Pr7_1_, nameaddres2_.Postal_Delivery_Cd as Postal_D8_1_, nameaddres2_.Phone_Number as Phone_Nu9_1_, nameaddres2_.Email_Addr as Email_Addr1_, nameaddres2_.Last_Updated_User_ID as Last_Up11_1_ from Agency.USER_AGENCY useragency0_ left outer join Agency.AGENCY agency1_ on useragency0_.Agency_Id=agency1_.Agency_ID left outer join Agency.NAMEADDRESS nameaddres2_ on agency1_.NameAddress_Id=nameaddres2_.NameAddress_Id where useragency0_.User_Id=? - 13:17:21,683 SQL:223
Hibernate: select useragency0_.User_Agency_ID as User_Age1_2_, useragency0_.User_Id as User_Id2_, useragency0_.Agency_Id as Agency_Id2_, agency1_.Agency_ID as Agency_ID0_, agency1_.Last_Updated_Tstamp as Last_Upd2_0_, agency1_.Agency_Abbr as Agency_A3_0_, agency1_.Name as Name0_, agency1_.Days_To_Save_Trans as Days_To_5_0_, agency1_.Save_Deleted_Trans as Save_Del6_0_, agency1_.Admin_User_id as Admin_Us7_0_, agency1_.Active_cd as Active_cd0_, agency1_.Last_Updated_User_ID as Last_Upd9_0_, agency1_.NameAddress_Id as NameAdd10_0_, nameaddres2_.NameAddress_Id as NameAddr1_1_, nameaddres2_.Last_Updated_Tstamp as Last_Upd2_1_, nameaddres2_.Name as Name1_, nameaddres2_.Addr_Line_1 as Addr_Lin4_1_, nameaddres2_.Addr_Line_2 as Addr_Lin5_1_, nameaddres2_.City as City1_, nameaddres2_.State_Province_cd as State_Pr7_1_, nameaddres2_.Postal_Delivery_Cd as Postal_D8_1_, nameaddres2_.Phone_Number as Phone_Nu9_1_, nameaddres2_.Email_Addr as Email_Addr1_, nameaddres2_.Last_Updated_User_ID as Last_Up11_1_ from Agency.USER_AGENCY useragency0_ left outer join Agency.AGENCY agency1_ on useragency0_.Agency_Id=agency1_.Agency_ID left outer join Agency.NAMEADDRESS nameaddres2_ on agency1_.NameAddress_Id=nameaddres2_.NameAddress_Id where useragency0_.User_Id=?
DEBUG preparing statement - 13:17:21,730 BatcherImpl:227
DEBUG binding '1' to parameter: 1 - 13:17:21,777 IntegerType:46
DEBUG processing result set - 13:17:21,824 Loader:196
DEBUG returning '1' as column: Agency_ID0_ - 13:17:21,871 IntegerType:68
DEBUG returning '1' as column: NameAddr1_1_ - 13:17:21,902 IntegerType:68
DEBUG returning '1' as column: User_Age1_2_ - 13:17:21,949 IntegerType:68
DEBUG result row: 1, 1, 1 - 13:17:21,980 Loader:404
DEBUG done processing result set (1 rows) - 13:17:22,027 Loader:225
DEBUG done closing: 0 open PreparedStatements, 0 open ResultSets - 13:17:22,058 BatcherImpl:199
DEBUG closing statement - 13:17:22,105 BatcherImpl:240
DEBUG total objects hydrated: 0 - 13:17:22,152 Loader:238
DEBUG done materializing entity [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:22,183 SessionImpl:2153
DEBUG initializing non-lazy collections - 13:17:22,214 SessionImpl:3000
DEBUG initializing collection [com.cds.icp.agencydataentry.hibernate.User.passwords#1] - 13:17:22,246 SessionImpl:3132
DEBUG about to open: 0 open PreparedStatements, 0 open ResultSets - 13:17:22,277 BatcherImpl:192
DEBUG select passwords0_.Password_ID as Password1___, passwords0_.User_ID as User_ID__, user1_.User_ID as User_ID0_, user1_.Last_Updated_Tstamp as Last_Upd2_0_, user1_.Active_ind as Active_ind0_, user1_.First_Name as First_Name0_, user1_.Last_Name as Last_Name0_, user1_.Email_addr as Email_addr0_, user1_.User_Name as User_Name0_, user1_.Email_Addr as Email_Addr0_, user1_.Last_Updated_User_ID as Last_Upd9_0_, groupdetai2_.Group_Detail_ID as Group_De1_1_, groupdetai2_.User_Id as User_Id1_, groupdetai2_.User_Group_ID as User_Gro3_1_, usergroup3_.User_Group_ID as User_Gro1_2_, usergroup3_.group_name as group_name2_, usergroup3_.Password_Valid_Days as Password3_2_, useragency4_.User_Agency_ID as User_Age1_3_, useragency4_.User_Id as User_Id3_, useragency4_.Agency_Id as Agency_Id3_, agency5_.Agency_ID as Agency_ID4_, agency5_.Last_Updated_Tstamp as Last_Upd2_4_, agency5_.Agency_Abbr as Agency_A3_4_, agency5_.Name as Name4_, agency5_.Days_To_Save_Trans as Days_To_5_4_, agency5_.Save_Deleted_Trans as Save_Del6_4_, agency5_.Admin_User_id as Admin_Us7_4_, agency5_.Active_cd as Active_cd4_, agency5_.Last_Updated_User_ID as Last_Upd9_4_, agency5_.NameAddress_Id as NameAdd10_4_, passwords0_.Password_ID as Password1_5_, passwords0_.Active_ind as Active_ind5_, passwords0_.Password as Password5_, passwords0_.Created_Tstamp as Created_4_5_, passwords0_.Created_User_ID as Created_5_5_, passwords0_.User_Id as User_Id5_ from Agency.PASSWORD passwords0_ left outer join Agency.USER user1_ on passwords0_.User_Id=user1_.User_ID left outer join Agency.GROUP_DETAIL groupdetai2_ on user1_.User_ID=groupdetai2_.User_Id left outer join Agency.USER_GROUP usergroup3_ on groupdetai2_.User_Group_ID=usergroup3_.User_Group_ID left outer join Agency.USER_AGENCY useragency4_ on user1_.User_ID=useragency4_.User_Id left outer join Agency.AGENCY agency5_ on useragency4_.Agency_Id=agency5_.Agency_ID where passwords0_.User_ID=? - 13:17:22,308 SQL:223
Hibernate: select passwords0_.Password_ID as Password1___, passwords0_.User_ID as User_ID__, user1_.User_ID as User_ID0_, user1_.Last_Updated_Tstamp as Last_Upd2_0_, user1_.Active_ind as Active_ind0_, user1_.First_Name as First_Name0_, user1_.Last_Name as Last_Name0_, user1_.Email_addr as Email_addr0_, user1_.User_Name as User_Name0_, user1_.Email_Addr as Email_Addr0_, user1_.Last_Updated_User_ID as Last_Upd9_0_, groupdetai2_.Group_Detail_ID as Group_De1_1_, groupdetai2_.User_Id as User_Id1_, groupdetai2_.User_Group_ID as User_Gro3_1_, usergroup3_.User_Group_ID as User_Gro1_2_, usergroup3_.group_name as group_name2_, usergroup3_.Password_Valid_Days as Password3_2_, useragency4_.User_Agency_ID as User_Age1_3_, useragency4_.User_Id as User_Id3_, useragency4_.Agency_Id as Agency_Id3_, agency5_.Agency_ID as Agency_ID4_, agency5_.Last_Updated_Tstamp as Last_Upd2_4_, agency5_.Agency_Abbr as Agency_A3_4_, agency5_.Name as Name4_, agency5_.Days_To_Save_Trans as Days_To_5_4_, agency5_.Save_Deleted_Trans as Save_Del6_4_, agency5_.Admin_User_id as Admin_Us7_4_, agency5_.Active_cd as Active_cd4_, agency5_.Last_Updated_User_ID as Last_Upd9_4_, agency5_.NameAddress_Id as NameAdd10_4_, passwords0_.Password_ID as Password1_5_, passwords0_.Active_ind as Active_ind5_, passwords0_.Password as Password5_, passwords0_.Created_Tstamp as Created_4_5_, passwords0_.Created_User_ID as Created_5_5_, passwords0_.User_Id as User_Id5_ from Agency.PASSWORD passwords0_ left outer join Agency.USER user1_ on passwords0_.User_Id=user1_.User_ID left outer join Agency.GROUP_DETAIL groupdetai2_ on user1_.User_ID=groupdetai2_.User_Id left outer join Agency.USER_GROUP usergroup3_ on groupdetai2_.User_Group_ID=usergroup3_.User_Group_ID left outer join Agency.USER_AGENCY useragency4_ on user1_.User_ID=useragency4_.User_Id left outer join Agency.AGENCY agency5_ on useragency4_.Agency_Id=agency5_.Agency_ID where passwords0_.User_ID=?
DEBUG preparing statement - 13:17:22,355 BatcherImpl:227
DEBUG binding '1' to parameter: 1 - 13:17:22,386 IntegerType:46
DEBUG result set contains (possibly empty) collection: [com.cds.icp.agencydataentry.hibernate.User.passwords#1] - 13:17:22,433 Loader:326
DEBUG uninitialized collection: initializing - 13:17:22,480 SessionImpl:2902
DEBUG processing result set - 13:17:22,511 Loader:196
DEBUG returning '1' as column: User_ID0_ - 13:17:22,558 IntegerType:68
DEBUG returning '1' as column: Group_De1_1_ - 13:17:22,589 IntegerType:68
DEBUG returning '2' as column: User_Gro1_2_ - 13:17:22,621 IntegerType:68
DEBUG returning '1' as column: User_Age1_3_ - 13:17:22,667 IntegerType:68
DEBUG returning '1' as column: Agency_ID4_ - 13:17:22,714 IntegerType:68
DEBUG returning '2' as column: Password1_5_ - 13:17:22,761 IntegerType:68
DEBUG result row: 1, 1, 2, 1, 1, 2 - 13:17:22,792 Loader:404
DEBUG Initializing object from ResultSet: 2 - 13:17:22,839 Loader:535
DEBUG Hydrating entity: com.cds.icp.agencydataentry.hibernate.Password#2 - 13:17:22,871 Loader:604
DEBUG returning 'Y' as column: Active_ind5_ - 13:17:22,917 StringType:68
DEBUG returning 'john ' as column: Password5_ - 13:17:22,949 StringType:68
DEBUG returning '25 May 2004 12:57:53' as column: Created_4_5_ - 13:17:22,996 TimestampType:68
DEBUG returning '1' as column: Created_5_5_ - 13:17:23,042 IntegerType:68
DEBUG returning '1' as column: User_Id5_ - 13:17:23,089 IntegerType:68
DEBUG returning '1' as column: User_ID__ - 13:17:23,136 IntegerType:68
DEBUG found row of collection: [com.cds.icp.agencydataentry.hibernate.User.passwords#1] - 13:17:23,167 Loader:288
DEBUG reading row - 13:17:23,199 SessionImpl:2925
DEBUG returning '2' as column: Password1___ - 13:17:23,246 IntegerType:68
DEBUG loading [com.cds.icp.agencydataentry.hibernate.Password#2] - 13:17:23,277 SessionImpl:1913
DEBUG attempting to resolve [com.cds.icp.agencydataentry.hibernate.Password#2] - 13:17:23,324 SessionImpl:2010
DEBUG resolved object in session cache [com.cds.icp.agencydataentry.hibernate.Password#2] - 13:17:23,371 SessionImpl:2026
DEBUG returning '1' as column: User_ID0_ - 13:17:23,417 IntegerType:68
DEBUG returning '1' as column: Group_De1_1_ - 13:17:23,449 IntegerType:68
DEBUG returning '2' as column: User_Gro1_2_ - 13:17:23,496 IntegerType:68
DEBUG returning '1' as column: User_Age1_3_ - 13:17:23,527 IntegerType:68
DEBUG returning '1' as column: Agency_ID4_ - 13:17:23,574 IntegerType:68
DEBUG returning '1' as column: Password1_5_ - 13:17:23,605 IntegerType:68
DEBUG result row: 1, 1, 2, 1, 1, 1 - 13:17:23,636 Loader:404
DEBUG Initializing object from ResultSet: 1 - 13:17:23,683 Loader:535
DEBUG Hydrating entity: com.cds.icp.agencydataentry.hibernate.Password#1 - 13:17:23,714 Loader:604
DEBUG returning 'Y' as column: Active_ind5_ - 13:17:23,761 StringType:68
DEBUG returning 'John ' as column: Password5_ - 13:17:23,808 StringType:68
DEBUG returning '25 May 2004 09:24:00' as column: Created_4_5_ - 13:17:23,855 TimestampType:68
DEBUG returning '1' as column: Created_5_5_ - 13:17:23,886 IntegerType:68
DEBUG returning '1' as column: User_Id5_ - 13:17:23,949 IntegerType:68
DEBUG returning '1' as column: User_ID__ - 13:17:23,996 IntegerType:68
DEBUG found row of collection: [com.cds.icp.agencydataentry.hibernate.User.passwords#1] - 13:17:24,027 Loader:288
DEBUG reading row - 13:17:24,074 SessionImpl:2925
DEBUG returning '1' as column: Password1___ - 13:17:24,105 IntegerType:68
DEBUG loading [com.cds.icp.agencydataentry.hibernate.Password#1] - 13:17:24,152 SessionImpl:1913
DEBUG attempting to resolve [com.cds.icp.agencydataentry.hibernate.Password#1] - 13:17:24,199 SessionImpl:2010
DEBUG resolved object in session cache [com.cds.icp.agencydataentry.hibernate.Password#1] - 13:17:24,245 SessionImpl:2026
DEBUG done processing result set (2 rows) - 13:17:24,277 Loader:225
DEBUG done closing: 0 open PreparedStatements, 0 open ResultSets - 13:17:24,324 BatcherImpl:199
DEBUG closing statement - 13:17:24,355 BatcherImpl:240
DEBUG total objects hydrated: 2 - 13:17:24,402 Loader:238
DEBUG resolving associations for [com.cds.icp.agencydataentry.hibernate.Password#2] - 13:17:24,433 SessionImpl:2129
DEBUG loading [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:24,480 SessionImpl:1913
DEBUG attempting to resolve [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:24,511 SessionImpl:2010
DEBUG resolved object in session cache [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:24,558 SessionImpl:2026
DEBUG done materializing entity [com.cds.icp.agencydataentry.hibernate.Password#2] - 13:17:24,605 SessionImpl:2153
DEBUG resolving associations for [com.cds.icp.agencydataentry.hibernate.Password#1] - 13:17:24,636 SessionImpl:2129
DEBUG loading [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:24,683 SessionImpl:1913
DEBUG attempting to resolve [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:24,714 SessionImpl:2010
DEBUG resolved object in session cache [com.cds.icp.agencydataentry.hibernate.User#1] - 13:17:24,761 SessionImpl:2026
DEBUG done materializing entity [com.cds.icp.agencydataentry.hibernate.Password#1] - 13:17:24,808 SessionImpl:2153
DEBUG 1 collections were found in result set - 13:17:24,839 SessionImpl:2961
DEBUG collection fully initialized: [com.cds.icp.agencydataentry.hibernate.User.passwords#1] - 13:17:24,886 SessionImpl:2979
DEBUG 1 collections initialized - 13:17:24,917 SessionImpl:2982
DEBUG closing session - 13:17:24,964 SessionImpl:546
DEBUG disconnecting session - 13:17:24,980 SessionImpl:3187
DEBUG returning connection to pool, pool size: 1 - 13:17:25,011 DriverManagerConnectionProvider:114
DEBUG transaction completion - 13:17:25,042 SessionImpl:558
****************************************************
The results of aUser:
****************************************************
aUser= com.cds.icp.agencydataentry.hibernate.User (id=41)
activeFlag= "Y"
emailAddress= null
firstName= "John "
groupDetail= com.cds.icp.agencydataentry.hibernate.GroupDetail (id=45)
lastName= "Bush "
lastUpdatedByUserId= java.lang.Integer (id=48)
lastUpdatedDateTime= java.sql.Timestamp (id=51)
middleInitial= null
passwords= net.sf.hibernate.collection.Set (id=54)
additions= null
collectionSnapshot= net.sf.hibernate.impl.SessionImpl$CollectionEntry (id=65)
directlyAccessible= false
initialized= true
session= net.sf.hibernate.impl.SessionImpl (id=68)
set= java.util.HashSet (id=72)
map= java.util.HashMap (id=75)
count= 2
entrySet= null
keySet= null
keySet= java.util.HashMap$1 (id=79)
loadFactor= 0.75
modCount= 2
table= java.util.HashMap$Entry[11] (id=81)
[0]= null
[1]= null
[2]= java.util.HashMap$Entry (id=83)
hash= 1023902167
key= com.cds.icp.agencydataentry.hibernate.Password (id=87)
activeFlag= "Y"
createdByUserId= java.lang.Integer (id=91)
createdDateTime= java.sql.Timestamp (id=92)
password= "john"
passwordId= java.lang.Integer (id=94)
user= com.cds.icp.agencydataentry.hibernate.User (id=41)
activeFlag= "Y"
emailAddress= null
firstName= "John "
groupDetail= com.cds.icp.agencydataentry.hibernate.GroupDetail (id=45)
lastName= "Bush "
lastUpdatedByUserId= java.lang.Integer (id=48)
lastUpdatedDateTime= java.sql.Timestamp (id=51)
middleInitial= null
passwords= net.sf.hibernate.collection.Set (id=54)
userAgency= com.cds.icp.agencydataentry.hibernate.UserAgency (id=61)
userId= java.lang.Integer (id=63)
userName= "john"
next= null
value= java.lang.Object (id=89)
[3]= null
[4]= null
[5]= java.util.HashMap$Entry (id=86)
[6]= null
[7]= null
[8]= null
[9]= null
[10]= null
threshold= 8
values= null
values= null
tempList= null
userAgency= com.cds.icp.agencydataentry.hibernate.UserAgency (id=61)
userId= java.lang.Integer (id=63)
userName= "john"
****************************************************
The question:
****************************************************
As you can hopefully see in the above results, cut from the Variables display of WSAD, after a breakpoint on the return statement. User object, aUser, contains a Set of Passwords, each Password object contains a User, which contains a Set of Passwords, each Password object contains a User, .......
I stopped, after expanding the list about 6 levels. This looks like an endless list. Is Hibernate really retrieving the data over and over again; or, is this just the way it is displayed?
Am I doing something wrong here? All I need is the User object and a single Set of Passwords.
Thanks.
|