use of org.hibernate.graph.spi.EntityGraphImplementor in project hibernate-orm by hibernate.
the class SessionImpl method createEntityGraph.
@Override
public EntityGraph<?> createEntityGraph(String graphName) {
checkOpen();
final EntityGraph named = getEntityManagerFactory().findEntityGraphByName(graphName);
if (named == null) {
return null;
}
if (EntityGraphImplementor.class.isInstance(named)) {
return ((EntityGraphImplementor) named).makeMutableCopy();
} else {
return named;
}
}
use of org.hibernate.graph.spi.EntityGraphImplementor in project hibernate-orm by hibernate.
the class MetamodelImpl method findEntityGraphsByType.
@Override
@SuppressWarnings("unchecked")
public <T> List<EntityGraph<? super T>> findEntityGraphsByType(Class<T> entityClass) {
final EntityType<T> entityType = entity(entityClass);
if (entityType == null) {
throw new IllegalArgumentException("Given class is not an entity : " + entityClass.getName());
}
final List<EntityGraph<? super T>> results = new ArrayList<>();
for (EntityGraph entityGraph : entityGraphMap.values()) {
if (!EntityGraphImplementor.class.isInstance(entityGraph)) {
continue;
}
final EntityGraphImplementor egi = (EntityGraphImplementor) entityGraph;
if (egi.appliesTo(entityType)) {
results.add(egi);
}
}
return results;
}
Aggregations