hibenate 면접 자료 총화



hibernate      
     hibernate 
1、 JDBC      ,              (connection,eparedStatement,resultSet); 
2、  DAO     ORM    DB     (java)    
3、 java         sql       ,  ORM          ,     

session.load session.get    
       ,load           Exception ,get   null 
load  lazy , get   lazy 
load          ,          ciglib,        (   lazy=true)      ,          ,         ,     Exception 
get        ,                       null 

hibernate lazy      session      
<class>  lazy          

     session        sessionFactory    
session  evict clear     ,   session            sessionFactory 
session sessionFactory         Map      
key      ID value       

get load iterator        save       

list iterate   ? 
* list          ,list        ,           
* iterate              ,        id       

list                      list       sql   

iterator N+1    
iterator            ID    sql                      sql  ,         DB 
list N+1    
       
       
              evict 

      : 
hibernate     

                  
            id 

         ,         ,              

          : 
*       ,  hibernate.cfg.xml   
<property name="hibernate.cache.use_query_cache">true</property> 
*         , : 
       query.setCacheable(true); 

---------------------------------------------- 

*       ,       
    session,      query.list()       
    list      query.setCacheable(true); 

     sql  ; 

*       ,       
    session,    query.list()       

   query.list()      sql,            session   

*       ,       
    session,    query.iterate()       

      query.list   ,query.iterate    ,  query.iterate        

*       ,       
    session,    query.list()       

    sql,  query.list     ,        sql 

*       ,       
    session,    query.list()       

   n     ,         ,       ,    session   
            id,  hibernate        id        
                ,    id          

*       ,       
    session,    query.list()       

      sql,              ,            id   
hibernate        id              




Transient        ? 
*                
*     session    

persistent        ? 
*   session    
* persistent                    
* persistent          (     ),        

detached        ? 
*                
*     session    

session.flush        : 
*      
*   sql 

session        flush 
*          
*     flush 
*       , :iterate 


좋은 웹페이지 즐겨찾기