IDEMPIERE-5963 Implement Sub-Partitioning and Detach Partition (#2287)

* IDEMPIERE-5963 Implement Sub-Partitioning and Detach Partition

- Fix NPE in callout
- Fix partition error with AD_Language column

* IDEMPIERE-5963 Implement Sub-Partitioning and Detach Partition

- Fix partition error with AD_Language column

* IDEMPIERE-5963 Implement Sub-Partitioning and Detach Partition

- Fix partition error with YesNo column
This commit is contained in:
hengsin 2024-04-03 18:06:00 +08:00 committed by Carlos Ruiz
parent d16538ae38
commit 8d80b478e8
3 changed files with 7 additions and 3 deletions

View File

@ -552,7 +552,9 @@ public class TablePartitionService implements ITablePartitionService {
name.append(partitionNamePrefix).append("_");
String s = rs.getString(partitionKeyColumn.getColumnName());
name.append(s);
if (DisplayType.isText(partitionKeyColumn.getAD_Reference_ID()))
if (DisplayType.isText(partitionKeyColumn.getAD_Reference_ID()) || partitionKeyColumn.getAD_Reference_ID() == DisplayType.YesNo
|| "EntityType".equals(partitionKeyColumn.getColumnName())
|| "AD_Language".equals(partitionKeyColumn.getColumnName()))
expression.append(DB.TO_STRING(s));
else if (partitionKeyColumn.getAD_Reference_ID() == DisplayType.Date)
expression.append(DB.TO_DATE(rs.getTimestamp(partitionKeyColumn.getColumnName())));

View File

@ -889,7 +889,9 @@ public class TablePartitionService implements ITablePartitionService {
updateStmt.append(partitionKeyColumn.getColumnName()).append("=");
if (DisplayType.isText(partitionKeyColumn.getAD_Reference_ID()))
if (DisplayType.isText(partitionKeyColumn.getAD_Reference_ID()) || partitionKeyColumn.getAD_Reference_ID() == DisplayType.YesNo
|| "EntityType".equals(partitionKeyColumn.getColumnName())
|| "AD_Language".equals(partitionKeyColumn.getColumnName()))
updateStmt.append("'").append(listValue).append("' ");
else
updateStmt.append(listValue).append(" ");

View File

@ -54,7 +54,7 @@ public class ColumnCallout implements IColumnCallout {
if (seqNo != null)
mTab.setValue("SeqNoPartition", null);
}
} else if ("RangePartitionInterval".equals(mField.getColumnName())) {
} else if ("RangePartitionInterval".equals(mField.getColumnName()) && value != null) {
MColumn column = MColumn.getCopy(Env.getCtx(), mTab.getRecord_ID(), null);
column.setRangePartitionInterval(value.toString());
String error = RangePartitionInterval.validateIntervalPattern(column);