Search in sources :

Example 1 with SingleUniqueKeyEntityLoaderStandard

use of org.hibernate.loader.ast.internal.SingleUniqueKeyEntityLoaderStandard in project hibernate-orm by hibernate.

the class AbstractEntityPersister method getUniqueKeyLoader.

protected SingleUniqueKeyEntityLoader<?> getUniqueKeyLoader(String attributeName) {
    final SingularAttributeMapping attribute = (SingularAttributeMapping) findByPath(attributeName);
    final SingleUniqueKeyEntityLoader<?> existing;
    if (uniqueKeyLoadersNew == null) {
        uniqueKeyLoadersNew = new IdentityHashMap<>();
        existing = null;
    } else {
        existing = uniqueKeyLoadersNew.get(attribute);
    }
    if (existing != null) {
        return existing;
    }
    final SingleUniqueKeyEntityLoader<?> loader = new SingleUniqueKeyEntityLoaderStandard<>(this, attribute);
    uniqueKeyLoadersNew.put(attribute, loader);
    return loader;
}
Also used : SingleUniqueKeyEntityLoaderStandard(org.hibernate.loader.ast.internal.SingleUniqueKeyEntityLoaderStandard) SingularAttributeMapping(org.hibernate.metamodel.mapping.SingularAttributeMapping)

Aggregations

SingleUniqueKeyEntityLoaderStandard (org.hibernate.loader.ast.internal.SingleUniqueKeyEntityLoaderStandard)1 SingularAttributeMapping (org.hibernate.metamodel.mapping.SingularAttributeMapping)1