We should change EntityKeyMetadata et al. into interfaces rather than specific classes. For now there would be just one (the current) implementation, but down the road it will allow us to let dialects plug in custom implementations.
This will be beneficial for amending dialect-specific meta-data such as the DBCollection in the case of MongoDB. For that we'd add a new dialect facet like this:
public interface CustomMetadataGridDialect extends GridDialect {
MetadataFactory getMetadataFactory();
}
public interface MetadataFactory {
EntityKeyMetadata getEntityKeyMetadata(String tableName, String[] columnNames, Object[] columnValues);
}
|