com.poscoict.glueframework.biz.activity.hibernate
Class GlueHibernateSearch
java.lang.Object
com.poscoict.glueframework.biz.activity.GlueActivity<GlueContext>
com.poscoict.glueframework.biz.activity.hibernate.GlueHibernateSearch
public class GlueHibernateSearch
- extends GlueActivity<GlueContext>
GlueHibernateSearch Activity. GlueHibernateSearch Class´Â Hibernate¿ë Select Query(HQL)¸¦ ½ÇÇàÇÏ°í ±× °á°ú°ªÀ» ÀúÀå ÇÏ°Ô µÈ´Ù. Ãß°¡ÀûÀÎ propertyÀÎ method-nameÀ»
»ç¿ëÇϸé, Value Object¿¡ Á¤ÀǵǾî ÀÖ´Â Business Logic Method¸¦ ¼öÇàÇÒ ¼ö ÀÖ´Ù.
Query File
- Sample Query
hbm.xml
- Sample Entity
»ç¿ë ¿¹
- case 1 :
- case 2 : named paramÀÌ entitiyÀÇ property¿Í °°°í, ctx key¿Í °°Áö ¾ÊÀº °æ¿ì
- case 3 : named paramÀÌ entitiyÀÇ property¿Í °°Áö ¾Ê°í, ctx key¿Í °°Àº °æ¿ì
- case 4 : named paramÀÌ entitiyÀÇ property¿Í °°Áö ¾Ê°í, ctx key¿Í °°Áö ¾ÊÀº °æ¿ì
- case 5 : Á¶È¸°á°ú entitiyÀÇ Æ¯Á¤ method invoke½Ã °íÁ¤°ª »ç¿ë
- case 6 : Á¶È¸°á°ú entitiyÀÇ Æ¯Á¤ method invoke½Ã º¯¼ö°ª »ç¿ë
Property ¼³Á¤
- dao : (Çʼö) applicationContext.xmlÀÇ DAO id. Hibernate¿ë dao id¸¦ ÀÔ·ÂÇÑ´Ù.
- sql-key : (Çʼö) xxx-hquery.glue_sqlÀÇ query id.
Hibernate¿ë Query(HQL)¸¦ ÁöÁ¤Çϸç, named query ÀÌ¿©¾ß ÇÑ´Ù.
- result-key : (¼±ÅÃ) Context¿¡ ´ã±â´Â Query ¼öÇà °á°ú Key.
[ default ] : _resultList.
¼öÇà °á°ú´Â ValueObjectÀÇ ListÇüÅÂÀÌ´Ù.
- 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°¡ °°Àº°Íµµ ±â¼úÇÑ´Ù.
- method-name : (¼±ÅÃ)Value Object¿¡ Á¤ÀǵǾî ÀÖ´Â Method ¸í
- method-param : (¼±ÅÃ)Method¿¡ ³Ñ°ÜÁÙ Parameter °ª.
method-param0, method-param1, ... method-paramN°ú °°ÀÌ ÁöÁ¤ °¡´ÉÇÏ´Ù.
ReflectionÀ» ÀÌ¿ëÇÏ¿© InvokeÇÏ´Â ¸Þ¼ÒµåÀÇ ÆĶó¹ÌÅÍ´Â StringÇü¸¸ °¡´ÉÇÏ´Ù. Áï À§ÀÇ ¿¹¿¡¼ VO¿¡´Â
setComm(String) ¸Þ¼Òµå°¡ Á¤ÀǵǾî ÀÖ¾î¾ß Çϸç setComm(BigDecimal)¸¸ Á¤ÀǵǾî ÀÖ´Ù¸é NoSuchMethodExceptionÀÌ ¹ß»ýÇÑ´Ù.
Methods inherited from class com.poscoict.glueframework.biz.activity.GlueActivity |
commitTransaction, getDao, getEventList, getName, getProperty, getPropertyNames, getTransition, rollbackTransaction, setEventList, setName, setProperty, setTransition |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GlueHibernateSearch
public GlueHibernateSearch()
preRunActivity
protected void preRunActivity(GlueContext ctx)
postRunActivity
protected void postRunActivity(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 ÇÑ´Ù.
¿¹)
==> return "success"À̸é BizLogic Activity ¸¦ ½ÇÇàÇÔ.
Copyright © 2013–2014 POSCO ICT SWÁ¦Ç°±â¼úÆÀ. All rights reserved.