use of org.pentaho.di.repository.ObjectId in project pentaho-kettle by pentaho.
the class KettleDatabaseRepository method deleteCondition.
public synchronized void deleteCondition(ObjectId id_condition) throws KettleException {
boolean ok = true;
ObjectId[] ids = getSubConditionIDs(id_condition);
if (ids.length > 0) {
// Delete the sub-conditions...
for (int i = 0; i < ids.length && ok; i++) {
deleteCondition(ids[i]);
}
// Then delete the main condition
deleteCondition(id_condition);
} else {
connectionDelegate.performDelete("DELETE FROM " + quoteTable(KettleDatabaseRepository.TABLE_R_CONDITION) + " WHERE " + quote(KettleDatabaseRepository.FIELD_CONDITION_ID_CONDITION) + " = ? ", id_condition);
}
}
use of org.pentaho.di.repository.ObjectId in project pentaho-kettle by pentaho.
the class KettleDatabaseRepository method delTransNotes.
public synchronized void delTransNotes(ObjectId id_transformation) throws KettleException {
ObjectId[] ids = getTransNoteIDs(id_transformation);
for (int i = 0; i < ids.length; i++) {
connectionDelegate.performDelete("DELETE FROM " + quoteTable(KettleDatabaseRepository.TABLE_R_NOTE) + " WHERE " + quote(KettleDatabaseRepository.FIELD_NOTE_ID_NOTE) + " = ? ", ids[i]);
}
connectionDelegate.performDelete("DELETE FROM " + quoteTable(KettleDatabaseRepository.TABLE_R_TRANS_NOTE) + " WHERE " + quote(KettleDatabaseRepository.FIELD_TRANS_NOTE_ID_TRANSFORMATION) + " = ? ", id_transformation);
}
use of org.pentaho.di.repository.ObjectId in project pentaho-kettle by pentaho.
the class KettleDatabaseRepository method readDatabases.
/**
* Read all the databases defined in the repository
*
* @return a list of all the databases defined in the repository
* @throws KettleException
*/
public List<DatabaseMeta> readDatabases() throws KettleException {
List<DatabaseMeta> databases = new ArrayList<>();
ObjectId[] ids = getDatabaseIDs(false);
for (int i = 0; i < ids.length; i++) {
// reads last
DatabaseMeta databaseMeta = loadDatabaseMeta(ids[i], null);
// versions
databases.add(databaseMeta);
}
return databases;
}
use of org.pentaho.di.repository.ObjectId in project pentaho-kettle by pentaho.
the class KettleDatabaseRepository method saveConditionStepAttribute.
/**
* This method saves the object ID of the condition object (if not null) in the step attributes
*
* @param id_step
* @param code
* @param condition
*/
public void saveConditionStepAttribute(ObjectId id_transformation, ObjectId id_step, String code, Condition condition) throws KettleException {
ObjectId id = null;
if (condition != null) {
id = saveCondition(condition);
Long id_condition = id == null ? Long.valueOf(-1L) : new LongObjectId(id).longValue();
saveStepAttribute(id_transformation, id_step, code, id_condition);
insertTransStepCondition(id_transformation, id_step, condition.getObjectId());
}
}
use of org.pentaho.di.repository.ObjectId in project pentaho-kettle by pentaho.
the class KettleDatabaseRepository method delJobNotes.
public synchronized void delJobNotes(ObjectId id_job) throws KettleException {
ObjectId[] ids = getJobNoteIDs(id_job);
for (int i = 0; i < ids.length; i++) {
connectionDelegate.performDelete("DELETE FROM " + quoteTable(KettleDatabaseRepository.TABLE_R_NOTE) + " WHERE " + quote(KettleDatabaseRepository.FIELD_NOTE_ID_NOTE) + " = ? ", ids[i]);
}
connectionDelegate.performDelete("DELETE FROM " + quoteTable(KettleDatabaseRepository.TABLE_R_JOB_NOTE) + " WHERE " + quote(KettleDatabaseRepository.FIELD_JOB_NOTE_ID_JOB) + " = ? ", id_job);
}
Aggregations