return ConversionManager.getDefaultManager().convertObject(value, type);
}
@Override
public PartitioningPolicy buildPolicy() {
ValuePartitioningPolicy policy = new ValuePartitioningPolicy();
super.buildPolicy(policy);
Class type = String.class;
if (this.partitionValueType != null) {
type = getJavaClass(getMetadataClass(this.partitionValueType));
}
policy.setDefaultConnectionPool(this.defaultConnectionPool);
for (ValuePartitionMetadata partition : getPartitions()) {
Object value = initObject(type, partition.getValue());
if (policy.getPartitions().containsKey(value)) {
throw ValidationException.duplicatePartitionValue(getName(), value);
}
policy.addPartition(value, partition.getConnectionPool());
}
return policy;
}