com.poscoict.glueframework.biz.activity.mongodb
Class GlueMongoSave

java.lang.Object
  extended by com.poscoict.glueframework.biz.activity.GlueActivity<GlueContext>
      extended by com.poscoict.glueframework.biz.activity.mongodb.GlueMongoSave

public class GlueMongoSave
extends GlueActivity<GlueContext>

MongoRepository¸¦ ÀÌ¿ëÇÑ Document ÀúÀå.

 Activity Property
 
 - repository : (Çʼö) applicationContext.xmlÀÇ repository id.
 
 - entity-id / entity-name : (Çʼö) µÑ Áß Çϳª¸¸ Ç×»ó ÀÖ¾î¾ß ÇÔ.
       entity-id :  ctx¿¡ ´ã±ä entity¸¦ ³ªÅ¸³»´Â key
       entity-name : »ý¼ºÇÏ°íÀÚ ÇÏ´Â entity class¸í
   
 - entity-bindings : (¼±ÅÃ) entity-nameÀÌ »ç¿ëµÉ °æ¿ì ÇÊ¿äÇÔ.
               binding¿¡ »ç¿ëµÇ´Â °ª°ú Mapping µÇ´Â Key( fieldName=ctxKey[|fieldName=ctxKey] ).
   
 - result-key : (¼±ÅÃ) Context¿¡ ´ã±â´Â mongodb ÀúÀå°á°ú
          [ default ] : {repository}_result
 
 
 
 ¿¹Á¦
 »ç¿ë ¿¹# 1
 
     <activity name="Custom" class="...">
         <transition name="success" value="Save" />
     </activity>
     <activity name="Save" class="com.poscoict.glueframework.biz.activity.mongodb.GlueMongoSave">
         <transition name="success" value="NextActivity" />
         <property name="repository" value="customerRepository" />
         <property name="entity-id" value="data" />
     </activity>
 
 
 »ç¿ë ¿¹# 2
 
     <activity name="Custom" class="...">
         <transition name="success" value="Save" />
     </activity>
     <activity name="Save" class="com.poscoict.glueframework.biz.activity.mongodb.GlueMongoSave">
         <transition name="success" value="NextActivity" />
         <property name="repository" value="customerRepository" />
         <property name="entity-id" value="dataList" />
     </activity>
 
 
 »ç¿ë ¿¹# 3
 
     <activity name="Custom" class="...">
         <transition name="success" value="SaveEntity" />
     </activity>
     <activity name="SaveEntity" class="com.poscoict.glueframework.biz.activity.mongodb.GlueMongoSave">
         <transition name="success" value="NextActivity" />
         <property name="repository" value="customerRepository" />
         <property name="entity-name" value="sample.vo.Customer" />
         <property name="entity-bindings" value="firstName=fName|lastName=lName" />
     </activity>
 
 
 
 Âü°í : applicationContext.xml
 
     <mongo:repositories base-package="sample.repository" />
 
 
 Âü°í : MongoRepository È®Àå
 
     package sample.repository;
     import org.springframework.data.mongodb.repository.MongoRepository;
     import sample.vo.Customer;
     public interface CustomerRepository extends MongoRepository<Customer, String> {
     }
 
 
 Âü°í : Document
 
     package sample.vo;
     import org.springframework.data.annotation.Id;
     import org.springframework.data.mongodb.core.mapping.Document;
     £À Document
     public class Customer {
         £À Id
         private String id;
         private String firstName;
         private String lastName;
         public Customer( String firstName, String lastName ) {
             this.firstName = firstName;
             this.lastName = lastName;
         }
     }
 
 
 Âü°í : Java Code (Custom)
 
     ctx.put( "data", new Customer("glue", "f/w") );
     List dataList = new ArrayList();
     dataList.add(new Customer("glue", "f/w"));
     dataList.add(new Customer("spring", "f/w"));
     ctx.put( "dataList", dataList );
     ctx.put( "fName", "glue" );
     ctx.put( "lName", "f/w" );
 

Author:
ȲÀ¯Áø

Field Summary
 
Fields inherited from class com.poscoict.glueframework.biz.activity.GlueActivity
dynamicProperties, logger
 
Constructor Summary
GlueMongoSave()
           
 
Method Summary
 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

GlueMongoSave

public GlueMongoSave()
Method Detail

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–2018 POSCO ICT. All rights reserved.