use of org.talend.designer.core.model.utils.emf.talendfile.ColumnType in project tdi-studio-se by Talend.
the class AddDdColumnMigrationTask method removeDbColumn.
private void removeDbColumn(Item item) throws PersistenceException {
ProcessType processType = getProcessType(item);
if (processType == null) {
return;
}
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
boolean modified = false;
for (Object o : processType.getNode()) {
NodeType node = (NodeType) o;
for (Object o2 : node.getMetadata()) {
MetadataType metadata = (MetadataType) o2;
for (Object o3 : metadata.getColumn()) {
ColumnType column = (ColumnType) o3;
if (column.getOriginalDbColumnName() != null) {
column.setOriginalDbColumnName(null);
modified = true;
}
}
}
}
if (modified) {
factory.save(item, true);
}
}
use of org.talend.designer.core.model.utils.emf.talendfile.ColumnType in project tdi-studio-se by Talend.
the class RenameCustomerColumnOftGenKey method changeCustomerColumn.
private void changeCustomerColumn(Item item) throws PersistenceException {
ProcessType processType = getProcessType(item);
if (processType == null) {
return;
}
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
boolean modified = false;
for (Object o : processType.getNode()) {
NodeType node = (NodeType) o;
for (Object o2 : node.getMetadata()) {
MetadataType metadata = (MetadataType) o2;
for (Object o3 : metadata.getColumn()) {
ColumnType column = (ColumnType) o3;
if ("T_WINDOW_KEY".equals(column.getName())) {
column.setName("T_GEN_KEY");
modified = true;
}
}
}
}
if (modified) {
factory.save(item, true);
}
}
use of org.talend.designer.core.model.utils.emf.talendfile.ColumnType in project tesb-studio-se by Talend.
the class RestRequestWrongCallMigrationTask method addColumn.
private void addColumn(EList columns, String name) {
Iterator iterator = columns.iterator();
while (iterator.hasNext()) {
Object next = iterator.next();
if (next instanceof ColumnType && name.equals(((ColumnType) next).getName())) {
return;
}
}
ColumnType columnType = TalendFileFactory.eINSTANCE.createColumnType();
columnType.setKey(false);
columnType.setName(name);
columnType.setSourceType("");
columnType.setType("id_String");
columnType.setLength(255);
columnType.setPrecision(0);
columnType.setNullable(true);
columns.add(columnType);
}
use of org.talend.designer.core.model.utils.emf.talendfile.ColumnType in project tesb-studio-se by Talend.
the class ConsumerFaultResponseMigrationTask method addColumn.
private void addColumn(EList column, String name) {
Iterator<?> iterator = column.iterator();
while (iterator.hasNext()) {
Object next = iterator.next();
if (next instanceof ColumnType) {
ColumnType ct = (ColumnType) next;
if (name.equals(ct.getName())) {
return;
}
}
}
ColumnType columnType = TalendFileFactory.eINSTANCE.createColumnType();
columnType.setDefaultValue("");
columnType.setKey(false);
columnType.setName(name);
columnType.setSourceType("");
columnType.setType("id_String");
columnType.setLength(1024);
columnType.setPrecision(0);
columnType.setNullable(true);
column.add(columnType);
}
use of org.talend.designer.core.model.utils.emf.talendfile.ColumnType in project tdi-studio-se by Talend.
the class RenametStandardizePhoneNumberColumnName method changeCustomerColumn.
private void changeCustomerColumn(Item item) throws PersistenceException {
ProcessType processType = getProcessType(item);
if (processType == null) {
return;
}
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
boolean modified = false;
for (Object o : processType.getNode()) {
NodeType node = (NodeType) o;
if ("tStandardizePhoneNumber".equalsIgnoreCase(node.getComponentName())) {
for (Object o2 : node.getMetadata()) {
MetadataType metadata = (MetadataType) o2;
for (Object o3 : metadata.getColumn()) {
ColumnType column = (ColumnType) o3;
if ("IsPossiblePhoneNumber ".equals(column.getName())) {
column.setName("IsPossiblePhoneNumber");
modified = true;
break;
}
}
}
}
}
if (modified) {
factory.save(item, true);
}
}
Aggregations