com.poscoict.glueframework.dao.hibernate
Class GlueHibernateDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by com.poscoict.glueframework.dao.hibernate.GlueHibernateDao
All Implemented Interfaces:
GlueGenericDao, GlueGenericHibernateDao, org.springframework.beans.factory.InitializingBean

public class GlueHibernateDao
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements GlueGenericHibernateDao

Hibernate¿ë Dao ClassÀÌ´Ù.

 Bean Property
 
 - queryManager : (Çʼö)
 
 - sessionFactory : (Çʼö)
 
 
 ¿¹Á¦
 »ç¿ë ¿¹# 1
 
     <bean id="dao" class="com.poscoict.glueframework.dao.hibernate.GlueHibernateDao">
         <property name="queryManager" ref="queryManager"/>
         <property name="sessionFactory" ref="sessionFactory"/>
     </bean>
 


Field Summary
 GlueQueryManager queryManager
           
 
Constructor Summary
GlueHibernateDao()
           
 
Method Summary
 Object createEntity(Object entity)
           
<P> Object
createEntity(String entityName, GlueParameter<P> param)
          ÁÖ¾îÁø named query¿Í GlueHibernateParameter·Î insertÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
protected  org.springframework.orm.hibernate3.HibernateTemplate createHibernateTemplate(org.hibernate.SessionFactory sessionFactory)
           
 int delete(String sqlkey)
          ÁÖ¾îÁø query·Î DeleteÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
<P> int
delete(String sqlkey, GlueParameter<P> param)
          ÁÖ¾îÁø named query¿Í GlueHibernateParameter·Î DeleteÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
 int deleteByHql(String hql)
           
<P> int
deleteByHql(String hql, GlueParameter<P> param)
           
<T> List<T>
find(String sqlkey)
          ÁÖ¾îÁø query·Î Á¶È¸ÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
<T,P> List<T>
find(String sqlkey, GlueParameter<P> param)
          ÁÖ¾îÁø named query¿¡ GlueParameter °´Ã¼¸¦ BindingÇÏ¿© Á¶È¸ÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
<T> List<T>
findByHql(String hql)
           
<T,P> List<T>
findByHql(String hql, GlueParameter<P> param)
           
 int insert(String sqlkey)
          HQLÀ» ÅëÇÑ insert´Â Áö¿øÇÏÁö ¾ÊÀ½. createEntity¸¦ »ç¿ëÇϼ¼¿ä.
<P> int
insert(String sqlkey, GlueParameter<P> param)
          HQLÀ» ÅëÇÑ insert´Â Áö¿øÇÏÁö ¾ÊÀ½. createEntity¸¦ »ç¿ëÇϼ¼¿ä.
 Object loadEntity(String entityName, Serializable id)
          ÀÌ ¸Þ¼Òµå´Â ÁöÁ¤ÇÑ Entity¸¦ ã¾Æ¼­ ReturnÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
<P> Object
modifyEntity(String entityName, Object entity, GlueParameter<P> param)
           
 Object removeEntity(Object entity)
           
 Object removeEntity(String entityName, Serializable entityId)
          ÀÌ ¸Þ¼Òµå´Â ÁöÁ¤ÇÑ Entity¸¦ ã¾Æ¼­ »èÁ¦ÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
 void setQueryManager(GlueQueryManager queryManager)
          setter method for DI.
 int update(String sqlkey)
          ÁÖ¾îÁø query·Î UpdateÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
<P> int
update(String sqlkey, GlueParameter<P> param)
          ÁÖ¾îÁø named query¿Í GlueHibernateParameter·Î UpdateÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
 int updateByHql(String hql)
           
<P> int
updateByHql(String hql, GlueParameter<P> param)
           
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryManager

public GlueQueryManager queryManager
Constructor Detail

GlueHibernateDao

public GlueHibernateDao()
Method Detail

setQueryManager

public void setQueryManager(GlueQueryManager queryManager)
setter method for DI. Setter Method for queryManager

Parameters:
queryManager - queryManager Object

createHibernateTemplate

protected org.springframework.orm.hibernate3.HibernateTemplate createHibernateTemplate(org.hibernate.SessionFactory sessionFactory)
Overrides:
createHibernateTemplate in class org.springframework.orm.hibernate3.support.HibernateDaoSupport

find

public <T> List<T> find(String sqlkey)
ÁÖ¾îÁø query·Î Á¶È¸ÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

Specified by:
find in interface GlueGenericDao
Parameters:
name - query name(id)
param - query¿¡ ¹ÙÀεùÇÒ Parameter °´Ã¼. GlueContext¸¦ °¡Áø GlueHibernateParameter
Returns:
°Ë»öµÈ ·¹Äڵ带 Ç¥ÇöÇÏ´Â RowSet

find

public <T,P> List<T> find(String sqlkey,
                          GlueParameter<P> param)
ÁÖ¾îÁø named query¿¡ GlueParameter °´Ã¼¸¦ BindingÇÏ¿© Á¶È¸ÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

Specified by:
find in interface GlueGenericDao
Parameters:
name - query name(id)
param - query¿¡ ¹ÙÀεùÇÒ Parameter °´Ã¼. GlueContext¸¦ °¡Áø GlueHibernateParameter
Returns:
°Ë»öµÈ ·¹Äڵ带 Ç¥ÇöÇÏ´Â RowSet

findByHql

public <T> List<T> findByHql(String hql)
Specified by:
findByHql in interface GlueGenericHibernateDao

findByHql

public <T,P> List<T> findByHql(String hql,
                               GlueParameter<P> param)
Specified by:
findByHql in interface GlueGenericHibernateDao

insert

public int insert(String sqlkey)
HQLÀ» ÅëÇÑ insert´Â Áö¿øÇÏÁö ¾ÊÀ½. createEntity¸¦ »ç¿ëÇϼ¼¿ä.

Specified by:
insert in interface GlueGenericDao
Parameters:
name - query id
Returns:
»ý¼ºµÈ ·¹ÄÚµå °³¼ö

insert

public <P> int insert(String sqlkey,
                      GlueParameter<P> param)
HQLÀ» ÅëÇÑ insert´Â Áö¿øÇÏÁö ¾ÊÀ½. createEntity¸¦ »ç¿ëÇϼ¼¿ä.

Specified by:
insert in interface GlueGenericDao
Parameters:
name - query id
Returns:
»ý¼ºµÈ ·¹ÄÚµå °³¼ö

update

public int update(String sqlkey)
ÁÖ¾îÁø query·Î UpdateÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. Ưº°ÇÑ °æ¿ì°¡ ¾Æ´Ï¸é Hibernate¿¡¼­ Query ¹æ½ÄÀ¸·Î Update¸¦ ±ÇÇÏÁö ¾Ê´Â´Ù.

Specified by:
update in interface GlueGenericDao
Parameters:
name - query id
param - GlueHibernateParameter Object
Returns:
¼öÁ¤µÈ ·¹ÄÚµå °³¼ö

update

public <P> int update(String sqlkey,
                      GlueParameter<P> param)
ÁÖ¾îÁø named query¿Í GlueHibernateParameter·Î UpdateÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. Ưº°ÇÑ °æ¿ì°¡ ¾Æ´Ï¸é Hibernate¿¡¼­ Query ¹æ½ÄÀ¸·Î Update¸¦ ±ÇÇÏÁö ¾Ê´Â´Ù.

Specified by:
update in interface GlueGenericDao
Parameters:
name - query id
param - GlueHibernateParameter Object
Returns:
¼öÁ¤µÈ ·¹ÄÚµå °³¼ö

updateByHql

public int updateByHql(String hql)
Specified by:
updateByHql in interface GlueGenericHibernateDao

updateByHql

public <P> int updateByHql(String hql,
                           GlueParameter<P> param)
Specified by:
updateByHql in interface GlueGenericHibernateDao

delete

public int delete(String sqlkey)
ÁÖ¾îÁø query·Î DeleteÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. Ưº°ÇÑ °æ¿ì°¡ ¾Æ´Ï¸é Hibernate¿¡¼­ Query ¹æ½ÄÀ¸·Î Delete¸¦ ±ÇÇÏÁö ¾Ê´Â´Ù.

Specified by:
delete in interface GlueGenericDao
Parameters:
name - query id
Returns:
»èÁ¦µÈ ·¹ÄÚµå °³¼ö

delete

public <P> int delete(String sqlkey,
                      GlueParameter<P> param)
ÁÖ¾îÁø named query¿Í GlueHibernateParameter·Î DeleteÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. Ưº°ÇÑ °æ¿ì°¡ ¾Æ´Ï¸é Hibernate¿¡¼­ Query ¹æ½ÄÀ¸·Î Delete¸¦ ±ÇÇÏÁö ¾Ê´Â´Ù.

Specified by:
delete in interface GlueGenericDao
Parameters:
name - query id
param - GlueHibernateParameter Object
Returns:
»èÁ¦µÈ ·¹ÄÚµå °³¼ö

deleteByHql

public int deleteByHql(String hql)
Specified by:
deleteByHql in interface GlueGenericHibernateDao

deleteByHql

public <P> int deleteByHql(String hql,
                           GlueParameter<P> param)
Specified by:
deleteByHql in interface GlueGenericHibernateDao

loadEntity

public Object loadEntity(String entityName,
                         Serializable id)
ÀÌ ¸Þ¼Òµå´Â ÁöÁ¤ÇÑ Entity¸¦ ã¾Æ¼­ ReturnÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

Specified by:
loadEntity in interface GlueGenericHibernateDao
Parameters:
entityName - ¿£Æ¼Æ¼¸í
entityId - ¿£Æ¼Æ¼ À¯ÀÏ Å°
Returns:
Object °´Ã¼

createEntity

public Object createEntity(Object entity)
Specified by:
createEntity in interface GlueGenericHibernateDao

createEntity

public <P> Object createEntity(String entityName,
                               GlueParameter<P> param)
ÁÖ¾îÁø named query¿Í GlueHibernateParameter·Î insertÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. Ưº°ÇÑ °æ¿ì°¡ ¾Æ´Ï¸é Hibernate¿¡¼­ Query ¹æ½ÄÀ¸·Î Insert¸¦ ±ÇÇÏÁö ¾Ê´Â´Ù.

Specified by:
createEntity in interface GlueGenericHibernateDao
Parameters:
name - query id

removeEntity

public Object removeEntity(String entityName,
                           Serializable entityId)
ÀÌ ¸Þ¼Òµå´Â ÁöÁ¤ÇÑ Entity¸¦ ã¾Æ¼­ »èÁ¦ÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

Specified by:
removeEntity in interface GlueGenericHibernateDao
Parameters:
entityName - ¿£Æ¼Æ¼¸í
entityId - ¿£Æ¼Æ¼ À¯ÀÏ Å°
Returns:
Object »èÁ¦µÈ °´Ã¼

removeEntity

public Object removeEntity(Object entity)
Specified by:
removeEntity in interface GlueGenericHibernateDao

modifyEntity

public <P> Object modifyEntity(String entityName,
                               Object entity,
                               GlueParameter<P> param)
Specified by:
modifyEntity in interface GlueGenericHibernateDao


Copyright © 2013–2017 POSCO ICT. All rights reserved.