|
@@ -16,6 +16,7 @@ import java.sql.SQLException;
|
|
|
*
|
|
|
* @author tangkc
|
|
|
* @author houxinyu
|
|
|
+ * @author jay li
|
|
|
* @since 2.11.1
|
|
|
*/
|
|
|
public class ChainRead extends AbstractSqlRead<ChainVO> {
|
|
@@ -29,10 +30,10 @@ public class ChainRead extends AbstractSqlRead<ChainVO> {
|
|
|
ChainVO chainVO = new ChainVO();
|
|
|
chainVO.setChainId(getStringFromRsWithCheck(rs, super.config.getChainNameField()));
|
|
|
chainVO.setBody(getStringFromRsWithCheck(rs, super.config.getElDataField()));
|
|
|
- if (StrUtil.isNotBlank(super.config.getNamespaceField())){
|
|
|
+ if (StrUtil.isNotBlank(super.config.getNamespaceField())) {
|
|
|
chainVO.setNamespace(getStringFromRs(rs, super.config.getNamespaceField()));
|
|
|
}
|
|
|
- if (StrUtil.isNotBlank(super.config.getRouteField())){
|
|
|
+ if (StrUtil.isNotBlank(super.config.getRouteField())) {
|
|
|
chainVO.setRoute(getStringFromRs(rs, super.config.getRouteField()));
|
|
|
}
|
|
|
return chainVO;
|
|
@@ -54,10 +55,15 @@ public class ChainRead extends AbstractSqlRead<ChainVO> {
|
|
|
|
|
|
@Override
|
|
|
public String buildQuerySql() {
|
|
|
+ if (StrUtil.isNotBlank(super.config.getChainCustomSql())) {
|
|
|
+ return super.config.getChainCustomSql();
|
|
|
+ }
|
|
|
+
|
|
|
String chainTableName = super.config.getChainTableName();
|
|
|
String chainApplicationNameField = super.config.getChainApplicationNameField();
|
|
|
+ String applicationName = super.config.getApplicationName();
|
|
|
|
|
|
- return StrUtil.format(SqlReadConstant.SQL_PATTERN, chainTableName, chainApplicationNameField);
|
|
|
+ return StrUtil.format(SqlReadConstant.SQL_PATTERN, chainTableName, chainApplicationNameField, applicationName);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -68,19 +74,19 @@ public class ChainRead extends AbstractSqlRead<ChainVO> {
|
|
|
String chainApplicationNameField = super.config.getChainApplicationNameField();
|
|
|
String applicationName = super.config.getApplicationName();
|
|
|
|
|
|
- if (StrUtil.isBlank(chainTableName)){
|
|
|
+ if (StrUtil.isBlank(chainTableName)) {
|
|
|
throw new ELSQLException("You did not define the chainTableName property");
|
|
|
}
|
|
|
- if (StrUtil.isBlank(elDataField)){
|
|
|
+ if (StrUtil.isBlank(elDataField)) {
|
|
|
throw new ELSQLException("You did not define the elDataField property");
|
|
|
}
|
|
|
- if (StrUtil.isBlank(chainNameField)){
|
|
|
+ if (StrUtil.isBlank(chainNameField)) {
|
|
|
throw new ELSQLException("You did not define the chainNameField property");
|
|
|
}
|
|
|
- if (StrUtil.isBlank(chainApplicationNameField)){
|
|
|
+ if (StrUtil.isBlank(chainApplicationNameField)) {
|
|
|
throw new ELSQLException("You did not define the chainApplicationNameField property");
|
|
|
}
|
|
|
- if (StrUtil.isBlank(applicationName)){
|
|
|
+ if (StrUtil.isBlank(applicationName)) {
|
|
|
throw new ELSQLException("You did not define the applicationName property");
|
|
|
}
|
|
|
}
|