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

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

public class GlueHibernateUpdate
extends GlueActivity<GlueContext>

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

 Activity Property
 
 - dao : (Çʼö) applicationContext.xmlÀÇ DAO id. Hibernate¿ë dao id¸¦ ÀÔ·ÂÇÑ´Ù.
 
 - entity-name : (Çʼö) Update ½Ã 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="Update" class="com.poscoict.glueframework.biz.activity.hibernate.GlueHibernateUpdate">
         <property name="dao" value="hibernateDao" />
         <property name="sql-key" value="emp.update" />
         <property name="entity-name" value="sample.vo.Employee" />
         <transition name="success" value="end" />
     </activity>
 
 
 »ç¿ë ¿¹# 2
 - named paramÀÌ entitiyÀÇ property¿Í °°°í, ctx key¿Í °°Áö ¾ÊÀº °æ¿ì
 
     <activity name="Update" class= "com.poscoict.glueframework.biz.activity.hibernate.GlueHibernateUpdate">
         <property name="dao" value="hibernateDao" />
         <property name="sql-key" value="emp.update" />
         <property name="entity-name" value="sample.vo.Employee" />
         <property name="param-bindings" value="comm=comm_u1|empno=empno_u1" />
         <transition name="success" value="end" />
     </activity>
 
 
 »ç¿ë ¿¹# 3
 - named paramÀÌ entitiyÀÇ property¿Í °°Áö ¾Ê°í, ctx key¿Í °°Àº °æ¿ì
 
     <activity name="Update" class="com.poscoict.glueframework.biz.activity.hibernate.GlueHibernateUpdate">
         <property name="dao" value="hibernateDao" />
         <property name="sql-key" value="emp.update2" />
         <property name="entity-name" value="sample.vo.Employee" />
         <property name="entity-bindings" value="comm1=comm|ename1=ename|job1=job" />
         <transition name="success" value="end" />
     </activity>
 
 
 »ç¿ë ¿¹# 4
 - named paramÀÌ entitiyÀÇ property¿Í °°Áö ¾Ê°í, ctx key¿Í °°Áö ¾ÊÀº °æ¿ì
 
     <activity name="Update" class= "com.poscoict.glueframework.biz.activity.hibernate.GlueHibernateUpdate">
         <property name="dao" value="hibernateDao" />
         <property name="sql-key" value="emp.update2" />
         <property name="entity-name" value="sample.vo.Employee" />
         <property name="entity-bindings" value="comm1=comm|ename1=ename|job1=job" />
         <property name="param-bindings" value="comm1=comm_u1|ename1=ename_u1|job1=job_u1" />
         <transition name="success" value="end" />
     </activity>
 
 
 
 Âü°í : {name}-hquery.glue_sql
 
     <query id="emp.update" desc="" isNamed="true">
         <![CDATA[
            update Employee set comm = :comm where empno = :empno
         ]]>
     </query>
     <query id="emp.update.2" desc="" isNamed="true">
         <![CDATA[
            update Employee set comm = :comm1 where ename = :ename1 and job = :job1
         ]]>
     </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
GlueHibernateUpdate()
           
 
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

GlueHibernateUpdate

public GlueHibernateUpdate()
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.