zoukankan      html  css  js  c++  java
  • hibernate 中的 lazy=”proxy” 和 lazy=”no-proxy” 的区别

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

    https://www.cnblogs.com/lizeyang/

  • 相关阅读:
    = =写个prim希望能够巨巨们看的懂
    poj2389 普通的大数乘法
    Codeforces 378C
    hdoj1272 小希的迷宫
    hihoCoder搜索二·骑士问题
    hihoCoder扩展欧几里得
    hihoCoder 1032
    664A
    【水水水】678A
    Codeforces Round #357 (Div. 2)C. Heap Operations
  • 原文地址:https://www.cnblogs.com/lizeyang/p/5839894.html
Copyright © 2011-2022 走看看