com.poscoict.glueframework.biz.activity.hibernate
Class GlueHibernateDelete

java.lang.Object
  extended by com.poscoict.glueframework.biz.activity.GlueActivity<GlueContext>
      extended by com.poscoict.glueframework.biz.activity.hibernate.GlueHibernateDelete

public class GlueHibernateDelete
extends GlueActivity<GlueContext>

GlueHibernateDelete Activity. GlueHibernateDelete Class´Â Hibernate¿ë Delete Query(HQL)¸¦ ½ÇÇàÇÏ°í ±× °á°ú°ª(Delete °Ç¼ö)À» ÀúÀåÇÑ´Ù.

 Activity Property
 
 - dao : (Çʼö) applicationContext.xmlÀÇ DAO id. Hibernate¿ë dao id¸¦ ÀÔ·ÂÇÑ´Ù.
 
 - entity-name : (Çʼö) Delete ½Ã HQLÀÇ Entity nameÀ» ÁöÁ¤ÇÑ´Ù. 
         named param¿¡ binding µÇ´Â °ªÀ» CastingÇÏ´Â ±Ù°Å°¡ µÈ´Ù..
 
 - sql-key : (Çʼö) xxx-hquery.glue_sqlÀÇ query id. 
         Hibernate¿ë Query(HQL)¸¦ ÁöÁ¤Çϸç, named query ÀÌ¿©¾ß ÇÑ´Ù. 
 
 - result-key : (¼±ÅÃ) Context¿¡ ´ã±â´Â Query ¼öÇà °á°ú Key.
         [ default ] : {sql-key}_result.
         ¼öÇà °á°ú´Â ¼öÇà°Ç¼öÀÌ´Ù.
 
 - entity-bindings : (¼±ÅÃ) hqlÀÇ named param°ú mappingµÇ´Â entity property ¶Ç´Â id nameÀ» Á¤ÀÇÇÑ´Ù.
         hqlÀÇ named param°ú ´ëÀÀ µÇ´Â entityÀÇ property ¶Ç´Â id °¡ °°À» °æ¿ì »ý·«ÇÑ´Ù.
         named param¿¡ binding µÇ´Â °ªÀº entity fieldÀÇ typeÀ¸·Î Casting ÇÏ´Â ±Ù°Å°¡ µÈ´Ù. 
 
 - param-bindings : (¼±ÅÃ) hqlÀÇ named param°ú binding¿¡ »ç¿ëµÇ´Â °ª°ú Mapping µÇ´Â Key.
         hqlÀÇ named param°ú ´ëÀÀ µÇ´Â ctxÀÇ key°¡ ÀüºÎ °°Àº °æ¿ì¸¸ »ý·«ÇÑ´Ù(´ë¼Ò¹®ÀÚ ±¸ºÐ).
         hqlÀÇ named param°ú ´ëÀÀ µÇ´Â ctxÀÇ key°¡ ÀüºÎ °°Áö ¾ÊÀ» °æ¿ì, binding data¸¦ À§ÇÑ º°µµÀÇ MapÀÌ »ý¼ºµÇ¹Ç·Î
         named param°ú ctx key°¡ °°Àº°Íµµ ±â¼úÇÑ´Ù.
 
 
 
 ¿¹Á¦
 »ç¿ë ¿¹# 1
 
     <activity name="Delete" class= "com.poscoict.glueframework.biz.activity.hibernate.GlueHibernateDelete">
         <property name="dao" value="hibernateDao" />
         <property name="sql-key" value="emp.delete" />
         <property name="entity-name" value="sample.vo.Employee" />
         <transition name="success" value="end" />
     </activity>
 
 
 »ç¿ë ¿¹# 2
 - named paramÀÌ entitiyÀÇ property¿Í °°°í, ctx key¿Í °°Áö ¾ÊÀº °æ¿ì
 
     <activity name="Delete" class= "com.poscoict.glueframework.biz.activity.hibernate.GlueHibernateDelete">
         <property name="dao" value="hibernateDao" />
         <property name="sql-key" value="emp.delete" />
         <property name="entity-name" value="sample.vo.Employee" />
         <property name="param-bindings" value="ename=ename_d1" />
         <transition name="success" value="end" />
     </activity>
 
 
 »ç¿ë ¿¹# 3
 - named paramÀÌ entitiyÀÇ property¿Í °°Áö ¾Ê°í, ctx key¿Í °°Àº °æ¿ì
 
     <activity name="Delete" class= "com.poscoict.glueframework.biz.activity.hibernate.GlueHibernateDelete">
         <property name="dao" value="hibernateDao" />
         <property name="sql-key" value="emp.delete2" />
         <property name="entity-name" value="sample.vo.Employee" />
         <property name="entity-bindings" value="ename1=ename|ename2=ename|ename3=ename" />
         <transition name="success" value="end" />
     </activity>
 
 
 »ç¿ë ¿¹# 4
 - named paramÀÌ entitiyÀÇ property¿Í °°Áö ¾Ê°í, ctx key¿Í °°Áö ¾ÊÀº °æ¿ì
 
     <activity name="Delete" class= "com.poscoict.glueframework.biz.activity.hibernate.GlueHibernateDelete">
         <property name="dao" value="hibernateDao" />
         <property name="sql-key" value="emp.delete2" />
         <property name="entity-name" value="sample.vo.Employee" />
         <property name="entity-bindings" value="ename1=ename|ename2=ename|ename3=ename" />
         <property name="param-bindings" value="ename1=ename_d1|ename2=ename_d2|ename3=ename_d3" />
         <transition name="success" value="end" />
     </activity>
 
 
 
 Âü°í : {name}-hquery.glue_sql
 
     <query id="emp.delete" desc="" isNamed="true">
         <![CDATA[ 
            delete Employee where empno = :empno
         ]]>
     </query>
     <query id="emp.delete.2" desc="" isNamed="true">
         <![CDATA[ 
            delete Employee where ename in (:ename1, :ename2, :ename3)
         ]]>
     </query>
 
 
 Âü°í : hbm.xml
 
     <hibernate-mapping>
         <class name="sample.vo.Employee" table="EMP" dynamic-update="true">
             <id name="empno" column="EMPNO" type="big_decimal"/>
             <property name="ename" column="ENAME" type="string"/>
             <property name="job" column="JOB" type="string"/>
             <property name="mgr" column="MGR" type="big_decimal"/>
             <property name="hiredate" column="HIREDATE" type="timestamp"/>
             <property name="sal" column="SAL" type="big_decimal"/>
             <property name="comm" column="COMM" type="big_decimal"/>
             <property name="deptno" column="DEPTNO" type="big_decimal"/>
         </class>
     </hibernate-mapping>
 


Field Summary
 
Fields inherited from class com.poscoict.glueframework.biz.activity.GlueActivity
dynamicProperties, logger
 
Constructor Summary
GlueHibernateDelete()
           
 
Method Summary
protected  void preRunActivity(GlueContext ctx)
           
 String runActivity(GlueContext ctx)
          Sub Class¿¡¼­ ¹Ýµå½Ã ±¸ÇöÇÏ¿©¾ß ÇÏ´Â Abstract Method À̸ç ÀÌ Method´Â F/W¿¡¼­ È£ÃâÇÑ´Ù.
 
Methods inherited from class com.poscoict.glueframework.biz.activity.GlueActivity
commitTransaction, commitTransaction, getDao, getEventList, getName, getProperty, getPropertyNames, getTransition, rollbackTransaction, rollbackTransaction, setEventList, setName, setProperty, setTransition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlueHibernateDelete

public GlueHibernateDelete()
Method Detail

preRunActivity

protected void preRunActivity(GlueContext ctx)

runActivity

public String runActivity(GlueContext ctx)
Description copied from class: GlueActivity
Sub Class¿¡¼­ ¹Ýµå½Ã ±¸ÇöÇÏ¿©¾ß ÇÏ´Â Abstract Method À̸ç ÀÌ Method´Â F/W¿¡¼­ È£ÃâÇÑ´Ù. °á°ú °ªÀº GlueContext¿¡ ´ã¾Æ¼­ ´ÙÀ½ Activity ¶Ç´Â F/W¿¡ Àü´ÞÇÏ°Ô µÈ´Ù. ÇÊ¿äÇÑ ¸ðµç Data´Â GlueContext¿¡¼­ È£ÃâÇÏ¿© »ç¿ëÇÏ°Ô µÈ´Ù.

Specified by:
runActivity in class GlueActivity<GlueContext>
Parameters:
ctx - GlueContext
Returns:
String Á¤»óÀûÀ̸é "success"¸¦ Return ÇÏ°í ºñÁ¤»ó 󸮸¦ ¿øÇϸé "failure"¸¦ Return ÇÑ´Ù.
 ¿¹) 
 <transition name="success" value="BizLogic"/>
 <transition name="failure" value="ErrorHandle"/>
 ==> return "success"À̸é BizLogic Activity ¸¦ ½ÇÇàÇÔ.
 


Copyright © 2013–2015 POSCO ICT SWÁ¦Ç°±â¼úÆÀ. All rights reserved.