use of org.pentaho.di.core.RowMetaAndData in project pentaho-kettle by pentaho.
the class KettleDatabaseRepositoryConnectionDelegate method getTransAttributeBoolean.
public synchronized boolean getTransAttributeBoolean(ObjectId id_transformation, int nr, String code) throws KettleException {
RowMetaAndData r = null;
r = getTransAttributeRow(id_transformation, nr, code);
if (r == null) {
return false;
}
return r.getBoolean(KettleDatabaseRepository.FIELD_TRANS_ATTRIBUTE_VALUE_STR, false);
}
use of org.pentaho.di.core.RowMetaAndData in project pentaho-kettle by pentaho.
the class KettleDatabaseRepositoryConnectionDelegate method getTransAttributeNumber.
public synchronized double getTransAttributeNumber(ObjectId id_transformation, int nr, String code) throws KettleException {
RowMetaAndData r = null;
r = getTransAttributeRow(id_transformation, nr, code);
if (r == null) {
return 0.0;
}
return r.getNumber(KettleDatabaseRepository.FIELD_TRANS_ATTRIBUTE_VALUE_NUM, 0.0);
}
use of org.pentaho.di.core.RowMetaAndData in project pentaho-kettle by pentaho.
the class KettleDatabaseRepositoryConnectionDelegate method insertJobEntryAttribute.
public synchronized ObjectId insertJobEntryAttribute(ObjectId id_job, ObjectId id_jobentry, long nr, String code, double value_num, String value_str) throws KettleException {
ObjectId id = getNextJobEntryAttributeID();
RowMetaAndData table = new RowMetaAndData();
// CHECKSTYLE:LineLength:OFF
table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_ID_JOBENTRY_ATTRIBUTE), id);
table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_ID_JOB), id_job);
table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_ID_JOBENTRY), id_jobentry);
table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_NR), new Long(nr));
table.addValue(new ValueMetaString(KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_CODE), code);
table.addValue(new ValueMetaNumber(KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_VALUE_NUM), new Double(value_num));
table.addValue(new ValueMetaString(KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_VALUE_STR), value_str);
database.prepareInsert(table.getRowMeta(), KettleDatabaseRepository.TABLE_R_JOBENTRY_ATTRIBUTE);
database.setValuesInsert(table);
database.insertRow();
database.closeInsert();
return id;
}
use of org.pentaho.di.core.RowMetaAndData in project pentaho-kettle by pentaho.
the class KettleDatabaseRepositoryConnectionDelegate method getNextTableID.
private synchronized LongObjectId getNextTableID(String tablename, String idfield) throws KettleException {
LongObjectId retval = null;
RowMetaAndData r = callRead(() -> database.getOneRow("SELECT MAX(" + idfield + ") FROM " + tablename));
if (r != null) {
Long id = r.getInteger(0);
if (id == null) {
if (log.isDebug()) {
log.logDebug("no max(" + idfield + ") found in table " + tablename);
}
retval = new LongObjectId(1);
} else {
if (log.isDebug()) {
log.logDebug("max(" + idfield + ") found in table " + tablename + " --> " + idfield + " number: " + id);
}
retval = new LongObjectId(id.longValue() + 1L);
}
}
return retval;
}
use of org.pentaho.di.core.RowMetaAndData in project pentaho-kettle by pentaho.
the class KettleDatabaseRepositoryConnectionDelegate method getJobAttributeInteger.
public synchronized long getJobAttributeInteger(ObjectId id_job, int nr, String code) throws KettleException {
RowMetaAndData r = null;
r = getJobAttributeRow(id_job, nr, code);
if (r == null) {
return 0L;
}
return r.getInteger(KettleDatabaseRepository.FIELD_JOB_ATTRIBUTE_VALUE_NUM, 0L);
}
Aggregations