if ( StringHelper.isEmpty( comment ) ) {
comment = null;
}
boolean callable = getBoolean( hints, QueryHints.CALLABLE, name );
NamedSQLQueryDefinition def;
if ( StringHelper.isNotEmpty( resultSetMapping ) ) {
def = new NamedSQLQueryDefinition(
name,
query, resultSetMapping, null, cacheable,
cacheRegion, timeout, fetchSize,
flushMode, cacheMode, readOnly, comment,
null, callable
);
}
else {
AnnotationValue annotationValue = annotation.value( "resultClass" );
if ( annotationValue == null ) {
throw new NotYetImplementedException( "Pure native scalar queries are not yet supported" );
}
NativeSQLQueryRootReturn queryRoots[] = new NativeSQLQueryRootReturn[] {
new NativeSQLQueryRootReturn(
"alias1",
annotationValue.asString(),
new HashMap<String, String[]>(),
LockMode.READ
)
};
def = new NamedSQLQueryDefinition(
name,
query,
queryRoots,
null,
cacheable,