|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.poscoict.glueframework.dao.manager.GlueQueryLoader
public class GlueQueryLoader

CacheLoader 구현체. 쿼리정보(GlueQueryDefinition)를 로딩하여 서비스하는 클래스.
config path에 존재하는 모든 xxx-query.glue_sql( or xxx-query.xml ) 파일 정보를 로딩하여 GlueQueryDefinition 을 생성한 후
java.util.HashMap을 구성한다.
config path에 존재하는 query file의 naming 및 확장자에 유의한다. Application do not use this class.
Bean Property
- rootPath : (필수) default는 'query'
- extraQueryFiles : (선택)
- loadDesc : (선택) default는 'false'
true 인 경우 GlueQuery File에서 desc 정보를 GlueQueryDefinition에 추가하므로 다음 코드 사용 가능함.
Strin desc = dao.getQueryManager().getQueryDefinition("emp.select").getDescription();
예제
사용 예# 1
- application의 classpath에서 query 폴더에 있는 쿼리파일을 로딩함.
사용 예# 2
- application의 classpath에서 rootPath 로 지정된 폴더에 있는 쿼리파일을 로딩함.
사용 예# 3
- application의 classpath의 rootPath외의 query 파일을 로딩함. jar 파일안에 master-query/easyaccess-query.glue_sql 이 있음.
master-query/easyaccess-query.glue_sql
사용 예# 4
- GlueQuery File에서 desc 정보도 GlueQueryDefinition에 추가할 경우
참고 : {name}-query.glue_sql
| Field Summary | |
|---|---|
protected static String |
QUERYMAP
Deprecated. |
| Constructor Summary | |
|---|---|
GlueQueryLoader()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
주어진 정보로 쿼리파일('*.glue_sql') List를 구성한다. rootPath(default는 'query')에 존재하는 모든 쿼리파일이 해당한다. |
String |
getRootPath()
getter method. |
Object |
loadCacheObject(Object cacheKey,
String regionName)
주어진 캐쉬 영역명에 해당하는 캐쉬영역에서 캐쉬 키를 사용하여 오브젝트를 로딩함 |
void |
setExtraQueryFiles(List<String> extraQueryFiles)
setter method for DI. |
void |
setLoadDesc(boolean loadDesc)
setter method for DI. |
void |
setPathEncoding(String pathEncoding)
setter method for DI. |
void |
setRootPath(String queryRoot)
setter method for DI. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Deprecated protected static final String QUERYMAP
| Constructor Detail |
|---|
public GlueQueryLoader()
| Method Detail |
|---|
public Object loadCacheObject(Object cacheKey,
String regionName)
throws GlueException
GlueCacheLoader
loadCacheObject in interface GlueCacheLoadercacheKey - 캐쉬 키regionName - 캐쉬 영역명
GlueException - - 캐쉬관련 에러발생 시public void setRootPath(String queryRoot)
queryRoot - 2가지 type이 가능. directory의 구분자는 슬래시(/)인지 역슬래시(\)인지 확인필요함.
1. Class Loader를 이용한 상대경로 지정2. glue.properties 이용한 절대 경로 지정 일 경우 ==> Thread.currentThread().getContextClassLoader().getResource( "ext/query" ) 가 사용됨. ext/query=C://apache-tomcat-7.0.47 ==> Thread.currentThread().getContextClassLoader().getResource( "C://apache-tomcat-7.0.47" ) 가 사용됨.
public void setExtraQueryFiles(List<String> extraQueryFiles)
extraQueryFiles - public void setLoadDesc(boolean loadDesc)
loadDesc - public void setPathEncoding(String pathEncoding)
pathEncoding - public String getRootPath()
public void afterPropertiesSet()
throws Exception
(non-Javadoc)URL url = GlueFileResourceUtil.getResource( "query" ); logger.trace( "{}' url : {}", rootPath, url ); 의 결과로 정리함. [was] 별 [url 값] Tomcat : file:/C:/apache-tomcat-7.0.47/work/Catalina/localhost/sample-ui/WEB-INF/classes/query/ Tomcat : file:/C:/apache-tomcat-7.0.47/webapps/sample-ui/WEB-INF/classes/query/ Tomcat 8 : jar:file:/C:/apache-tomcat-8.0.18/webapps/sample-ui.war!/WEB-INF/classes/query/ jBoss AS : vfs:/C:/jboss-eap-6.2/bin/content/sample-ui.war/WEB-INF/classes/query/ jBoss AS : vfs:/C:/jboss-eap-6.2/standalone/deployments/sample-ui.war/WEB-INF/classes/query/ WebLogic : zip:C:/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/_appsdir_sample-ui_war/wq0kqk/war/WEB-INF/lib/_wl_cls_gen.jar!/query WebSphere : file:/C:/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/hwangyujin-pcNode01Cell/sample-ui.ear/sample-ui.war/WEB-INF/classes/query/ Zeus : java : jar, jar:file:/C:/eclipse/workspace-glue-4-sample/sample-schedule-2/build/user-application.jar!/query
afterPropertiesSet in interface InitializingBeanExceptionInitializingBean.afterPropertiesSet()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||