
public class GlueMongoSave extends GlueActivity<GlueContext>
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
사용 예# 2
사용 예# 3
참고 : applicationContext.xml
참고 : MongoRepository 확장
package sample.repository;
import org.springframework.data.mongodb.repository.MongoRepository;
import sample.vo.Customer;
public interface CustomerRepository extends MongoRepository {
}
참고 : 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" );
dynamicProperties, logger| Constructor and Description |
|---|
GlueMongoSave() |
| Modifier and Type | Method and Description |
|---|---|
String |
runActivity(GlueContext ctx)
Sub Class에서 반드시 구현하여야 하는 Abstract Method 이며 이 Method는 F/W에서 호출한다.
|
commitTransaction, commitTransaction, getDao, getEventList, getName, getProperty, getPropertyNames, getTransition, rollbackTransaction, rollbackTransaction, setEventList, setName, setProperty, setTransitionpublic String runActivity(GlueContext ctx)
GlueActivityrunActivity in class GlueActivity<GlueContext>ctx - GlueContext예)==> return "success"이면 BizLogic Activity 를 실행함.
Copyright © 2013–2021 POSCO ICT. All rights reserved.