*/
@Override
public void initialize(DatabaseMapping mapping, Session session) {
// Ensure the mapping has the correct field classification set.
if (mapping.isDirectToFieldMapping()) {
DirectToFieldMapping m = (DirectToFieldMapping) mapping;
if (disableConversion) {
m.setConverter(null);
} else {
m.setConverter(this);
m.setFieldClassification(fieldClassification);
m.setFieldClassificationClassName(fieldClassificationName);
}
} else if (mapping.isDirectMapMapping() && isForMapKey) {
DirectMapMapping m = (DirectMapMapping) mapping;
if (disableConversion) {
m.setKeyConverter(null);
} else {
m.setKeyConverter(this);
m.setDirectKeyFieldClassification(fieldClassification);
m.setDirectKeyFieldClassificationName(fieldClassificationName);
}
} else if (mapping.isDirectCollectionMapping()) {
DirectCollectionMapping m = (DirectCollectionMapping) mapping;
if (disableConversion) {
m.setValueConverter(null);
} else {
m.setValueConverter(this);
m.setDirectFieldClassification(fieldClassification);
m.setDirectFieldClassificationName(fieldClassificationName);
}
} else {
// TODO: what else could it be???
}
}