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

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. python基础学习笔记2

    词典   词典(dictionary)与列表相似,也可以存储多个元素.存储多个元素的对象称为容器(container); 常见的创建词典的方法: >>>dic = {'tom':11 ...

  2. 修改nginx版本名称伪装任意web server

    如何修改nginx默认的名称,可以稍微的伪装一下,也可以装x 一般来说修改3个位置,一个是nginx.h.另一个是ngx_http_header_filter_module.c.还有一个ngx_htt ...

  3. linux下c程序的链接、装载和库(2)

    5. 重定义错误. 一个最终的可执行文件里,绝对不允许出现两个同名的全局变量,也不允许出现同名的全局函数. 全局函数:只要不用 static 修饰符修饰的函数,全部都是全局的. 全局变量:函数外声明定 ...

  4. MySQL中优化sql语句查询常用的30种方法

      1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使 ...

  5. MATLAB连接ACCESS数据库

    1.创建Windows系统ODBC数据源<打开控制面板----管理工具----ODBC数据源(32位或64位)----添加----安装数据源的驱动程序Microsoft Access Drive ...

  6. ABP之动态WebAPI(一)

    ABP的动态WebApi实现了直接对服务层的调用(其实病没有跨过ApiController,只是将ApiController公共化,对于这一点的处理类似于MVC,对服务端的 调用没有跨过HttpHan ...

  7. JMeter专题系列(二)录制脚本

    环境 Badboy  version 2.1.1 JDK: 1.7.0_67 Apache  JMeter-2.11 ----------------------------------------- ...

  8. JavaScript 数据类型

    JavaScript 数据类型 字符串.数字.布尔.数组.对象.Null.Undefined JavaScript 拥有动态类型.这意味着相同的变量可用作不同的类型: 一,JavaScript 字符串 ...

  9. 征友记之---前端开发Partner

                                                       简单自述下: 本人前端开发者,深圳一公司在职员工,非出自前端科班,乃自学前端已近两年之久. 受前端 ...

  10. 使用NuGet助您玩转代码生成数据————Entity Framework 之 Code First

    [前言] 如果是Code First老鸟或者对Entity Framework不感兴趣,就不用浪费时间往下看了. 记得09年第一次接触ORM————Linq2Sql,从此对她的爱便一发不可收拾,一年后 ...