就是如果我知道了主控方的信息(比如在学生和课程,主控方设为学生),根据学生的信息,修改学生所选的课程。那么学生的选课情况反映在学生的po中,就是一个set。在创建一个学生的时候,肯定要给出这个学生的所选的课程,课程在我的设计中是单独维护的,根据课程的id 号,我会load出来学生所选的所有的课程,构建一个set,之后student.setCourses(),再save(student)。ok。
那么修改一个学生的选课信息呢(比如我要去掉一个学生的某门课程)?如何做呢?由于我构建学生的vo,不是在session中。
可以这样修改:
在你得parentpojo 增加以下方法:
updateChildrenset(Set newChildernSet){
//get intersection elements 取交集
this.getChildrenSet().retainAll(newChildernSet);
//get the refresh set in new set 新的集合中取补集
newChildernSet.removeAll( this.getChildrenSet());
// get the refreshed data 最终的集合
this.getChildrenSet().addAll(newChildernSet);
}
分享到:
相关推荐
关于mysql 提示too many connections问题解决办法mysql 提示too many connections是由于当前服务器上的mysql连接过多,一方面清当前已有连接,另一方面是改 max_connections (最大连接量)(就是开源节流思想),我...
第一次上传,要5分,是物有所值,处理了jsonplugin 的no session的问题,并且添加了,新的注释,例如 ...2.对one-ton-many ,one-to-one ,值设为null(被设置为延迟加载的时候) 3.不需要配置底层实体,在当前action配置就可以
Cannot modify a const object ---------------不允许修改常量对象 Case outside of switch ----------------漏掉了case 语句 Case syntax error ------------------ Case 语法错误 Code has no effect ---------...
7.5.1. 一对多(one to many) /多对一( many to one) 7.5.2. 一对一(one to one) 7.5.3. 多对多(many to many) 7.6. 更复杂的关联映射 8. 组件(Component)映射 8.1. 依赖对象(Dependent objects) ...
7.5.1. 一对多(one to many) /多对一( many to one) 7.5.2. 一对一(one to one) 7.5.3. 多对多(many to many) 7.6. 更复杂的关联映射 8. 组件(Component)映射 8.1. 依赖对象(Dependent objects) ...
7.5.1. 一对多(one to many) /多对一( many to one) 7.5.2. 一对一(one to one) 7.5.3. 多对多(many to many) 7.6. 更复杂的关联映射 8. 组件(Component)映射 8.1. 依赖对象(Dependent objects) ...
8.5.1. 一对多(one to many) /多对一( many to one) 8.5.2. 一对一(one to one) 8.5.3. 多对多(many to many) 9. 组件(Component)映射 9.1. 依赖对象(Dependent objects) 9.2. 在集合中出现的依赖...
7.4.1. 一对多(one to many) / 多对一(many to one) 7.4.2. 一对一(one to one) 7.5. 使用连接表的双向关联(Bidirectional associations with join tables) 7.5.1. 一对多(one to many) /多对一( many ...
unity游戏防修改时间作弊源码(防止单机手游修改本地时间作弊) Time-cheat prevention (unity 2020 android 10亲测可用) Mobile (iOS, Android) native plugin to prevent cheating by changing phone time in ...
口语化 扩展的库 Notes和Laravel兼容性 该软件包是jenssegers/mongodb的包装。 除了新功能和更改的行为外,用法和配置与基本... 例如One-to-Many关系可以分为三类: One-to-Few , One-to-Many , One-to-Squillion
一对多(one to many) /多对一( many to one) 7.5.2. 一对一(one to one) 7.5.3. 多对多(many to many) 7.6. 更复杂的关联映射 8. 组件(Component)映射 8.1. 依赖对象(Dependent objects) 8.2. 在...
7.4.1. 一对多(one to many) / 多对一(many to one) 7.4.2. 一对一(one to one) 7.5. 使用连接表的双向关联(Bidirectional associations with join tables) 7.5.1. 一对多(one to many) /多对一( many ...
7.5.1. 一对多(one to many) /多对一( many to one) 7.5.2. 一对一(one to one) 7.5.3. 多对多(many to many) 8. 组件(Component)映射 8.1. 依赖对象(Dependent objects) 8.2. 在集合中出现的依赖对象 ...
7.5.1. 一对多(one to many) /多对一( many to one) 7.5.2. 一对一(one to one) 7.5.3. 多对多(many to many) 7.6. 更复杂的关联映射 8. 组件(Component)映射 8.1. 依赖对象(Dependent objects) 8.2. 在...
7.5.1. 一对多(one to many) /多对一( many to one) 7.5.2. 一对一(one to one) 7.5.3. 多对多(many to many) 8. 组件(Component)映射 8.1. 依赖对象(Dependent objects) 8.2. 在集合中出现的依赖对象 ...
一对多(one to many) /多对一( many to one) 8.5.2. 一对一(one to one) 8.5.3. 多对多(many to many) 9. 组件(Component)映射 9.1. 依赖对象(Dependent objects) 9.2. 在集合中出现的依赖对象 ...
8.5.1. 一对多(one to many) /多对一( many to one) 8.5.2. 一对一(one to one) 8.5.3. 多对多(many to many) 9. 组件(Component)映射 9.1. 依赖对象(Dependent objects) 9.2. 在集合中出现的依赖...
8.5.1. 一对多(one to many) /多对一( many to one) 8.5.2. 一对一(one to one) 8.5.3. 多对多(many to many) 9. 组件(Component)映射 9.1. 依赖对象(Dependent objects) 9.2. 在集合中出现的依赖...
好用的软件,class修改器 JavaBite was designed from the porting of patent pending security routines running in Windows. It is a Win32 application that allows a complete insight into the inner workings ...
Many organizations made early investments in BPM and workflow automation solutions that were hard to install and maintain, costly to own, and relied on closed architectures, which made them difficult ...