/**
* INTERNAL:
*/
@Override
public PartitioningPolicy buildPolicy() {
RangePartitioningPolicy policy = new RangePartitioningPolicy();
super.buildPolicy(policy);
Class type = String.class;
if (this.partitionValueType != null) {
type = getJavaClass(getMetadataClass(this.partitionValueType));
}
for (RangePartitionMetadata partition : getPartitions()) {
Comparable startValue = null;
if (partition.getStartValue() != null) {
startValue = (Comparable)initObject(type, partition.getStartValue());
}
Comparable endValue = null;
if (partition.getEndValue() != null) {
endValue = (Comparable)initObject(type, partition.getEndValue());
}
policy.addPartition(new RangePartition(partition.getConnectionPool(), startValue, endValue));
}
return policy;
}