本文整理汇总了Java中org.pentaho.di.trans.Trans.getCurrentDate方法的典型用法代码示例。如果您正苦于以下问题:Java Trans.getCurrentDate方法的具体用法?Java Trans.getCurrentDate怎么用?Java Trans.getCurrentDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.trans.Trans
的用法示例。
在下文中一共展示了Trans.getCurrentDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLogRecord
import org.pentaho.di.trans.Trans; //导入方法依赖的package包/类
/**
* This method calculates all the values that are required
* @param id the id to use or -1 if no id is needed
* @param status the log status to use
* @param subject the subject to query, in this case a Trans object
*/
public RowMetaAndData getLogRecord(LogStatus status, Object subject, Object parent) {
if (subject==null || subject instanceof Trans) {
Trans trans = (Trans) subject;
Result result = null;
if (trans!=null) result = trans.getResult();
RowMetaAndData row = new RowMetaAndData();
for (LogTableField field : fields) {
if (field.isEnabled()) {
Object value = null;
if (trans!=null) {
switch(ID.valueOf(field.getId())){
case ID_BATCH : value = new Long(trans.getBatchId()); break;
case CHANNEL_ID : value = trans.getLogChannelId(); break;
case TRANSNAME : value = trans.getName(); break;
case STATUS : value = status.getStatus(); break;
case LINES_READ : value = new Long(result.getNrLinesRead()); break;
case LINES_WRITTEN : value = new Long(result.getNrLinesWritten()); break;
case LINES_INPUT : value = new Long(result.getNrLinesInput()); break;
case LINES_OUTPUT : value = new Long(result.getNrLinesOutput()); break;
case LINES_UPDATED : value = new Long(result.getNrLinesUpdated()); break;
case LINES_REJECTED : value = new Long(result.getNrLinesRejected()); break;
case ERRORS: value = new Long(result.getNrErrors()); break;
case STARTDATE: value = trans.getStartDate(); break;
case LOGDATE: value = trans.getLogDate(); break;
case ENDDATE: value = trans.getEndDate(); break;
case DEPDATE: value = trans.getDepDate(); break;
case REPLAYDATE: value = trans.getCurrentDate(); break;
case LOG_FIELD:
value = getLogBuffer(trans, trans.getLogChannelId(), status, logSizeLimit);
break;
}
}
row.addValue(field.getFieldName(), field.getDataType(), value);
row.getRowMeta().getValueMeta(row.size()-1).setLength(field.getLength());
}
}
return row;
}
else {
return null;
}
}