iMES 2014-12-26 15:10
浏览 2933

Hibernate4懒加载失效 多次查询数据库

D-D 22:49:34,351 org.hibernate.SQL DEBUG select registrati0_.MemberId as MemberId3_1_, registrati0_.Id as Id1_, registrati0_.Id as Id4_0_, registrati0_.CreateTime as CreateTime4_0_, registrati0_.MemberId as MemberId4_0_, registrati0_.Name as Name4_0_, registrati0_.TrainingSchoolId as Training5_4_0_ from NDEP.dbo.Registrations registrati0_ where registrati0_.MemberId=?
D-D 22:49:34,351 org.hibernate.loader.Loader DEBUG Result set contains (possibly empty) collection: [com.mvc.frame.model.Members.registrationses#21]
D-D 22:49:34,351 internal.CollectionLoadContext DEBUG 1 collections were found in result set for role: com.mvc.frame.model.Members.registrationses
D-D 22:49:34,351 internal.CollectionLoadContext DEBUG Collection fully initialized: [com.mvc.frame.model.Members.registrationses#21]
D-D 22:49:34,351 internal.CollectionLoadContext DEBUG 1 collections initialized for role: com.mvc.frame.model.Members.registrationses
D-D 22:49:34,351 nal.StatefulPersistenceContext DEBUG Initializing non-lazy collections
D-D 22:49:34,351 org.hibernate.loader.Loader DEBUG Done loading collection
D-D 22:49:34,351 org.hibernate.loader.Loader DEBUG Loading collection: [com.mvc.frame.model.Members.memberBlacklistIpses#21]
D-D 22:49:34,351 org.hibernate.SQL DEBUG select memberblac0_.MemberId as MemberId3_1_, memberblac0_.id as id1_, memberblac0_.id as id2_0_, memberblac0_.CreateTime as CreateTime2_0_, memberblac0_.IpAddress as IpAddress2_0_, memberblac0_.MemberId as MemberId2_0_ from NDEP.dbo.MemberBlacklistIps memberblac0_ where memberblac0_.MemberId=?
D-D 22:49:34,351 org.hibernate.loader.Loader DEBUG Result set contains (possibly empty) collection: [com.mvc.frame.model.Members.memberBlacklistIpses#21]
D-D 22:49:34,351 internal.CollectionLoadContext DEBUG 1 collections were found in result set for role: com.mvc.frame.model.Members.memberBlacklistIpses
D-D 22:49:34,351 internal.CollectionLoadContext DEBUG Collection fully initialized: [com.mvc.frame.model.Members.memberBlacklistIpses#21]
D-D 22:49:34,351 internal.CollectionLoadContext DEBUG 1 collections initialized for role: com.mvc.frame.model.Members.memberBlacklistIpses
D-D 22:49:34,351 nal.StatefulPersistenceContext DEBUG Initializing non-lazy collections
D-D 22:49:34,351 org.hibernate.loader.Loader DEBUG Done loading collection
D-D 22:49:34,351 estResponseBodyMethodProcessor DEBUG Written [com.mvc.common.bean.SearchResult@4f2ce7fa] as "application/json;charset=UTF-8" using [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter@d31f6b2]
D-D 22:49:34,351 .web.servlet.DispatcherServlet DEBUG Null ModelAndView returned to DispatcherServlet with name 'springmvc': assuming HandlerAdapter completed request handling
D-D 22:49:34,351 .web.servlet.DispatcherServlet DEBUG Successfully completed request
D-D 22:49:34,351 upport.OpenSessionInViewFilter DEBUG Closing Hibernate Session in OpenSessionInViewFilter
D-D 22:49:34,351 internal.LogicalConnectionImpl DEBUG Releasing JDBC connection
D-D 22:49:34,356 internal.LogicalConnectionImpl DEBUG Released JDBC connection
D-D 22:49:34,356 l.proxy.ConnectionProxyHandler DEBUG HHH000163: Logical connection releasing its physical connection
D-D 22:49:34,408 upport.OpenSessionInViewFilter DEBUG Using SessionFactory 'sessionFactory' for OpenSessionInViewFilter
D-D 22:49:34,409 ort.DefaultListableBeanFactory DEBUG Returning cached instance of singleton bean 'sessionFactory'
D-D 22:49:34,409 upport.OpenSessionInViewFilter DEBUG Opening Hibernate Session in OpenSessionInViewFilter
D-D 22:49:34,409 hibernate.internal.SessionImpl DEBUG Opened session at timestamp: 14196053744
D-D 22:49:34,409 upport.OpenSessionInViewFilter DEBUG Closing Hibernate Session in OpenSessionInViewFilter
D-D 22:49:34,416 upport.OpenSessionInViewFilter DEBUG Using SessionFactory 'sessionFactory' for OpenSessionInViewFilter
D-D 22:49:34,416 ort.DefaultListableBeanFactory DEBUG Returning cached instance of singleton bean 'sessionFactory'
D-D 22:49:34,416 upport.OpenSessionInViewFilter DEBUG Opening Hibernate Session in OpenSessionInViewFilter
D-D 22:49:34,416 hibernate.internal.SessionImpl DEBUG Opened session at timestamp: 14196053744
D-D 22:49:34,416 upport.OpenSessionInViewFilter DEBUG Closing Hibernate Session in OpenSessionInViewFilter

*******************hibernate实体****************************

@LazyCollection(LazyCollectionOption.TRUE)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "members")
public Set<Registrations> getRegistrationses() {
    return this.registrationses;
}

public void setRegistrationses(Set<Registrations> registrationses) {
    this.registrationses = registrationses;
}

@LazyCollection(LazyCollectionOption.TRUE)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "members")
public Set<MemberBlacklistIps> getMemberBlacklistIpses() {
    return this.memberBlacklistIpses;
}

public void setMemberBlacklistIpses(Set<MemberBlacklistIps> memberBlacklistIpses) {
    this.memberBlacklistIpses = memberBlacklistIpses;
}
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 matlab图像高斯低通滤波
    • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
    • ¥15 钢筋实图交点识别,机器视觉代码
    • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
    • ¥50 400g qsfp 光模块iphy方案
    • ¥15 两块ADC0804用proteus仿真时,出现异常
    • ¥15 关于风控系统,如何去选择
    • ¥15 这款软件是什么?需要能满足我的需求
    • ¥15 SpringSecurityOauth2登陆前后request不一致
    • ¥15 禅道二次开发编辑版本,上传不了发行包