Search in sources :

Example 1 with UnknownSqlResultSetMappingException

use of org.hibernate.query.UnknownSqlResultSetMappingException in project hibernate-orm by hibernate.

the class Util method resolveResultSetMappingNames.

public static void resolveResultSetMappingNames(String[] resultSetMappingNames, ResultSetMapping resultSetMapping, Consumer<String> querySpaceConsumer, ResultSetMappingResolutionContext context) {
    final NamedObjectRepository namedObjectRepository = context.getSessionFactory().getQueryEngine().getNamedObjectRepository();
    for (String resultSetMappingName : resultSetMappingNames) {
        final NamedResultSetMappingMemento memento = namedObjectRepository.getResultSetMappingMemento(resultSetMappingName);
        if (memento == null) {
            throw new UnknownSqlResultSetMappingException("Unknown SqlResultSetMapping [" + resultSetMappingName + "]");
        }
        memento.resolve(resultSetMapping, querySpaceConsumer, context);
    }
}
Also used : NamedObjectRepository(org.hibernate.query.named.NamedObjectRepository) UnknownSqlResultSetMappingException(org.hibernate.query.UnknownSqlResultSetMappingException) NamedResultSetMappingMemento(org.hibernate.query.named.NamedResultSetMappingMemento)

Aggregations

UnknownSqlResultSetMappingException (org.hibernate.query.UnknownSqlResultSetMappingException)1 NamedObjectRepository (org.hibernate.query.named.NamedObjectRepository)1 NamedResultSetMappingMemento (org.hibernate.query.named.NamedResultSetMappingMemento)1