HHH-11495 Update the javadoc of Metamodel#getImplementors to reflect the actual implementation

In particular, the actual implementations may not return all persisted
subtypes if the given type is persisted and "explicit polymorphism" is
enabled. So this really is more about HQL queries than about a class
hierarchy.
This commit is contained in:
Yoann Rodière 2018-07-03 13:41:50 +02:00 committed by Guillaume Smet
parent 600164869b
commit 212d8c01e5
2 changed files with 9 additions and 12 deletions

View File

@ -39,7 +39,15 @@ public interface Metamodel extends javax.persistence.metamodel.Metamodel {
String getImportedClassName(String className);
/**
* Get the names of all persistent classes that implement/extend the given interface/class
* Given the name of an entity class, determine all the class and interface names by which it can be
* referenced in an HQL query.
*
* @param entityName The name of the entity class
*
* @return the names of all persistent (mapped) classes that extend or implement the
* given class or interface, accounting for implicit/explicit polymorphism settings
* and excluding mapped subclasses/joined-subclasses of other classes in the result.
* @throws MappingException
*/
String[] getImplementors(String entityName);

View File

@ -614,17 +614,6 @@ public class MetamodelImpl implements MetamodelImplementor, Serializable {
}
}
/**
* Given the name of an entity class, determine all the class and interface names by which it can be
* referenced in an HQL query.
*
* @param className The name of the entity class
*
* @return the names of all persistent (mapped) classes that extend or implement the
* given class or interface, accounting for implicit/explicit polymorphism settings
* and excluding mapped subclasses/joined-subclasses of other classes in the result.
* @throws MappingException
*/
@Override
public String[] getImplementors(String className) throws MappingException {
// computeIfAbsent() can be a contention point and we expect all the values to be in the map at some point so