网上找到个描述的很精妙的例子

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没区别。

更多详情请关注 http://www.cnblogs.com/baixingqiang

Child <- many-to-one ->Parent的更多相关文章

  1. 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 ...

  2. The specified child already has a parent错误

    10-05 23:39:48.187: E/AndroidRuntime(12854): Caused by: java.lang.IllegalStateException: The specifi ...

  3. bug_ _fragment_“The specified child already has a parent. You must call removeView"的解决以及产生的原因

    这个异常的出现往往是因为非法使用了某些方法引起的. 从字面意思上是说这个特定的child已经有一个parent了,你必须在这个parent中首先调用removeView()方法,才能继续你的内容.这里 ...

  4. 关于报错The specified child already has a parent的解决办法

    报错信息为:java.lang.IllegalStateException: The specified child already has a parent. You must call remov ...

  5. Android IllegalStateException: The specified child already has a parent问题解决办法

    最近遇到一个很让人头疼的问题,使用viewpager动态添加页面或者删除页面时出现了问题(java.lang.IllegalStateException: The specified child al ...

  6. 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 ...

  7. 安卓java.lang.IllegalStateException: The specified child already has a parent.解决方案

    在使用ViewPager的时候遇到一个错误java.lang.IllegalStateException: The specified child already has a parent. You ...

  8. 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 ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. jQuery鼠标经过显示大图

    效果:http://keleyi.com/keleyi/phtml/image/8.htm 以下是完整代码: <!DOCTYPE html> <html lang="en& ...

  2. js--找字符串中出现最多的字符

    在一个字符串中,如 'zhaochucichuzuiduodezifu',我们要找出出现最多的字符.本文章将详细说明方法思路. 先介绍两个string对象中的两个方法:indexOf()和charAt ...

  3. js中Unicode转义序列

    将某一中文字符转义,可采取在线工具进行转义,http://tool.chinaz.com/tools/unicode.aspx "哈哈" ==="\u54c8\u54c8 ...

  4. 开发环境(Atom + NotePad++)

    1.NodeJS Gulp:前端构建工具Grunt:前端构建工具Bower:客户端依赖管理工具Karma: 单元测试Protractor: 集成测试Git:版本控制ngScenario:情景测试(sc ...

  5. GCD封装的个人理解和应用

    GCD封装的个人理解和应用 特点 >>将GCD封装,使我们从繁琐的方法记忆中解脱出来,能够直接快速的应用. 使用方法 1.将工程中的GCD文件中的9个文件拖入自己的工程中(你自己最好建一个 ...

  6. EditText 显示明文和密码

    1.效果图 2.布局文件 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xml ...

  7. CSS3 选择器——属性选择器

    上一节在<CSS3选择器——基本选择器>中主要介绍了CSS3选择器的第一部分,这节主要和大家一起来学习CSS3选择器的第二部分——属性选择器.属性选择器早在CSS2中就被引入了,其主要作用 ...

  8. IOS 图片上传处理 图片压缩 图片处理

    - (void)initActionSheet { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil dele ...

  9. iOS推送(利用极光推送)

    本文主要是基于极光推送的SDK封装的一个快速集成极光推送的类的封装(不喜勿喷) (1)首先说一下推送的一些原理: Push的原理: Push 的工作机制可以简单的概括为下图 图中,Provider是指 ...

  10. TCP Provider The semaphore timeout period has expired

    我们一数据库服务器上有个作业最近几天偶尔会遇到下面错误(敏感信息已做处理),主要是报"TCP Provider: The semaphore timeout period has expir ...