use of com.cubrid.common.ui.cubrid.table.control.RangePartitionComparator in project cubrid-manager by CUBRID.
the class TableEditorPart method loadPartitionInfoList.
/**
* Load partition information list
*/
private void loadPartitionInfoList() {
boolean isPartitionTable = false;
if (!isNewTableFlag) {
isPartitionTable = "YES".equals(oldSchemaInfo.isPartitionGroup());
}
if (isPartitionTable) {
GetPartitionedClassListTask task = new GetPartitionedClassListTask(database.getDatabaseInfo());
List<PartitionInfo> list = task.getPartitionItemList(newSchemaInfo.getClassname());
partitionInfoList.clear();
if (!ArrayUtil.isEmpty(list)) {
PartitionInfo partitionInfo = list.get(0);
if (partitionInfo != null && partitionInfo.getPartitionType() == PartitionType.RANGE) {
RangePartitionComparator comparator = new RangePartitionComparator(partitionInfo.getPartitionExprType());
Collections.sort(list, comparator);
}
partitionInfoList.addAll(list);
}
}
oldPartitionInfoList = new ArrayList<PartitionInfo>();
for (int i = 0; i < partitionInfoList.size(); i++) {
PartitionInfo partitionInfo = partitionInfoList.get(i);
if (partitionInfo != null) {
oldPartitionInfoList.add(partitionInfo.clone());
}
}
if (oldSchemaInfo != null) {
oldSchemaInfo.setPartitionList(oldPartitionInfoList);
}
if (newSchemaInfo != null) {
newSchemaInfo.setPartitionList(partitionInfoList);
}
}
Aggregations