ERROR LazyInitializationException:42 - failed to lazily initialize a collection of role: com.lixueli.business.model.Person.events, no session or session was closed
在配置文件中加入lazy="false"即可
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.lixueli.business.model.Person" table="person">
<id name="id" column="PERSON_ID">
<generator class="native"></generator>
</id>
<property name="age"></property>
<property name="firstName"></property>
<property name="lastName"></property>
<set name="events" table="PERSON_EVENT" lazy="false">
<key column="PERSON_ID"></key>
<many-to-many column="EVENT_ID" class="com.lixueli.business.model.Event"></many-to-many>
</set>
</class>
</hibernate-mapping>
分享到:
相关推荐
Understand exactly how JavaScript works in a web browser environment and how these mechanisms power our event-driven JavaScript code Use promises to turn complex synchronization scenarios into ...
npm install --save react-lazily-render 用法 () import React from 'react' ; import LazilyRender from 'react-lazily-render' ; ...lots of content... < LazilyRender xss=removed> } content = { ...
- **.NET as a Reaction to the Java World**: Microsoft’s response to Sun Microsystems’ Java platform, aiming to provide a robust framework for building and running applications. - **The Open Source...
`lazily`:金鱼慵懒地(lazily)成群结队地在水面下游动。 - 15. `coats`:他们给前门刷了三层(coats)油漆。 2. **关键短语或词组**: - 1. `come along`:一起来,过来。 - 2. `a novel called…`:一本叫做...
committed, the command line prompt script failed to notice the current status, which has been improved. * Many GIT_TEST_* environment variables control various aspects of how our tests are run, ...
- 完成句子练习可以帮助巩固词汇的应用,如:"The young man rose lazily and was not willing to greet us."(年轻人懒洋洋地起身,并不愿意向我们打招呼。),"This appointment was greeted with relief."(这个...
-- data-qazy is set to true means to load it lazily. Set it to false if you don't want to load it lazily. --> <!-- A default placeholder is used. To change the placeholder, assign the variable ...
特征图片标签和IMG srcset支持Webp检测占位符HTML && CSS图像支持下载图像时的第一个渲染自定义可见性百分比渲染图像时的自定义回调安装npm install react-lazily-img --save 演示版即将推出。它是如何工作的 ? ...
Exporting a lazily initialized bean (which implements SelfNaming and is annotated with ManagedResource annotation) gives IllegalStateException [SPR-17592] #22124 MockHttpServletRequest changes Accept-...
- **Lazily-Instantiated Beans**:介绍了延迟加载Bean的概念,即在真正需要的时候才加载Bean实例。 - **Autowiring Collaborators**:通过autowire属性自动装配Bean之间的依赖关系。 - **Checking for Dependencies...
- ` Lazily loaded images`:利用`loading="lazy"`属性延迟加载图片。 开放式问题涉及的技能和流程,如JavaScript延迟加载技术、关注的技术趋势、开发流程与使用的工具、网站性能优化策略、原型继承和闭包的理解等...
- 以辅音字母+y结尾的词,如"lazily",改y为i再加"-er/est",形成"lazier"和"laziest"。 - 以不发音的e结尾的形容词,如"large",直接加"-r/-st",得到"larger"和"largest"。 - 多音节和某些双音节词,如...
- **Lazily-instantiated beans**: 延迟加载Bean,直到第一次请求时才初始化。 - **Autowiring collaborators**: 自动装配协作对象,简化了配置。 - **Checking for dependencies**: 检查Bean是否存在未满足的依赖。...
- **例句:** 他伸了伸懒腰,打了个哈欠 (he stretched and yawned lazily)。 13. **壮丽的 (splendid)** - **定义:** 形容宏伟壮观的事物。 - **例句:** 这座宫殿非常豪华 (splendid palace)。 14. **一道菜...
lazily. Copyright (c) 2009 Armando Blancas. All rights reserved. The use and distribution terms for this software are covered by the Eclipse Public License 1.0 ...
3. 冠词:"a good worker",不定冠词a用于表示泛指,此处表示“一个好工人”。 4. 形容词与过去分词的区别:"Although surprised",形容词surprised用于表示人的感受。 5. 连词:"because he really needed help",...
获取所有文件 具有延迟同步和异步迭代器支持的出色的快速递归目录搜寻器。 安装 支持Node.js版本10及更高版本。 $ npm i get-all-files 用法 import getAllFiles from ... // Could break early on some condition a
Kodein is a very simple and yet very useful dependency retrieval container. it is very easy to use and configure. Kodein works: On the JVM. On Android. On Javascript (both in the browser and on Node....