Child <- many-to-one ->Parent
网上找到个描述的很精妙的例子
Child <- many-to-one ->Parent
class Child {
private Parent parent;
public Parent getParent (){
return this.parent;//访问了实例变量
}
}
class Parent {
private String name;
public String getName(){
return this.name;//访问了实例变量
}
public void f(){
System.out.println("invokeing f()");//没有访问实例变量
}
}
如果 many-to-one
的lazy设为proxy,当child.getParent().getName()或child.getParent().f()时,parent都
会被抓取,若设为no-proxy,调用child.getParent().f()时,parent是不会被抓取的,同时这种方式需要编译时字节码增
强,否则和proxy没区别。
Child <- many-to-one ->Parent的更多相关文章
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
在ViewPager中,用Fragment显示页面时,报错: java.lang.IllegalStateException: The specified child already has a pa ...
- The specified child already has a parent错误
10-05 23:39:48.187: E/AndroidRuntime(12854): Caused by: java.lang.IllegalStateException: The specifi ...
- bug_ _fragment_“The specified child already has a parent. You must call removeView"的解决以及产生的原因
这个异常的出现往往是因为非法使用了某些方法引起的. 从字面意思上是说这个特定的child已经有一个parent了,你必须在这个parent中首先调用removeView()方法,才能继续你的内容.这里 ...
- 关于报错The specified child already has a parent的解决办法
报错信息为:java.lang.IllegalStateException: The specified child already has a parent. You must call remov ...
- Android IllegalStateException: The specified child already has a parent问题解决办法
最近遇到一个很让人头疼的问题,使用viewpager动态添加页面或者删除页面时出现了问题(java.lang.IllegalStateException: The specified child al ...
- Pass value from child popup window to parent page window using JavaScript--reference
Here Mudassar Ahmed Khan has explained how to pass value from child popup window to parent page wind ...
- 安卓java.lang.IllegalStateException: The specified child already has a parent.解决方案
在使用ViewPager的时候遇到一个错误java.lang.IllegalStateException: The specified child already has a parent. You ...
- android 异常信息The specified child already has a parent. You must call removeView() on the child's parent first. 的处理方法
[Android异常信息]: The specified child already has a parent. You must call removeView() on the child's p ...
- fragment The specified child already has a parent. You must call removeView()
在切换Fragment的时候出现:The specified child already has a parent. You must call removeView()异常. 错误主要出在Fragm ...
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView
java.lang.IllegalStateException: The specified child already has a parent. You must call removeVi ...
随机推荐
- Java 批量插入数据(Oracle)
//批量添加20000条数据用时8秒. try { String url = "jdbc:oracle:thin:@IP:1521:orcl"; // orcl为数据库的SI ...
- spice server dpkg-buildpackage 打包编译备忘
一般我们会通过configure,make 编译.但是为了替换版本的方便需要把他编译成deb的包,而且还需要自定义下包名.下面就记录下我的修改过程. 注:前面关于spice server的编译过程掠过 ...
- PHP流程控制之循环结构
计算机程序最擅长的功能之一就是按规定的条件,重复执行某些操作.循环结构可以减少源程序重复书写的工作量,即在给定条件成立时,反复执行某程序段,直到条件不成立为止.给定的条件称为循环条件,反复执行的程序段 ...
- 原型对象prototype和原型属性[[Prototype]]
构造器:可以被 new 运算符调用, Boolean,Number,String,Date,RegExp,Error,Function,Array,Object 都是构造器,他们有各自的实现方式. 比 ...
- js 阻止事件冒泡和默认行为 preventDefault、stopPropagation、return false
preventDefault: preventDefault它是事件对象(Event)的一个方法,作用是取消一个目标元素的默认行为.既然是说默认行为,当然是元素必须有默认行为才能被取消,如果元素本身就 ...
- Json解析,Json-lib
网络资源参考 http://www.json.org/json-zh.html http://code.alibabatech.com/wiki/pages/viewpage.action?pageI ...
- DYN-B201 Dynamics CRM 云生产力解决方案与功能简介
DYN-B201 Dynamics CRM 云生产力解决方案与功能简介 讲师:王健.林松涛Dynamics CRM 云产品正式落地中国,CRM 与 Azure.O365 深度整合无缝集成,带来无与伦比 ...
- gcc boost版本冲突解决日记
问题背景 项目在Ubuntu10 64位 boost 1.55,boost采用的是项目内包含相对目录的形式部署 项目采用了 -Wall -Wextra -Werror -Wconversion 最高的 ...
- IOS开发之Bug--使用KVC的易错情况
1.其实某些角度而言KVC是一个破坏封装又暴力的做法,而我已经两次因为KVC而导致应用程序出现闪退的情况. 场景:1.使用KVC修改某一个UIView的属性,比如width. 2.在viewWi ...
- JAVA之直接内存(DirectMemory)
Baisics: JAVA NIO使用,基于通道和缓冲区的IO方式,使用Native函数库直接分配堆外内存(allocateDirect),然后通过一个Java堆中的DirectByteBuffer对 ...