{
namedQueries = new HashSet<QueryMetaData>();
}
for (int j=0;j<queries.length;j++)
{
QueryMetaData qmd = new QueryMetaData(cmd, null, queries[j].name(), QueryLanguage.JPQL.toString(),
"true", null, null, null, null);
qmd.setQuery(queries[j].query());
namedQueries.add(qmd);
}
}
else if (annName.equals(JPAAnnotationUtils.NAMED_QUERY))
{
if (namedQueries == null)
{
namedQueries = new HashSet<QueryMetaData>();
}
QueryMetaData qmd = new QueryMetaData(cmd, null, (String)annotationValues.get("name"),
QueryLanguage.JPQL.toString(), "true", null, null, null, null);
qmd.setQuery((String)annotationValues.get("query"));
namedQueries.add(qmd);
}
else if (annName.equals(JPAAnnotationUtils.NAMED_NATIVE_QUERIES))
{
NamedNativeQuery[] queries = (NamedNativeQuery[])annotationValues.get("value");
if (namedQueries == null)
{
namedQueries = new HashSet<QueryMetaData>();
}
for (int j=0;j<queries.length;j++)
{
String resultClassName = null;
if (queries[j].resultClass() != null && queries[j].resultClass() != void.class)
{
resultClassName = queries[j].resultClass().getName();
}
String resultMappingName = null;
if (queries[j].resultSetMapping() != null)
{
resultMappingName = queries[j].resultSetMapping();
}
QueryMetaData qmd = new QueryMetaData(cmd, null, queries[j].name(), QueryLanguage.SQL.toString(),
"true", resultClassName, resultMappingName, null, null);
qmd.setQuery(queries[j].query());
namedQueries.add(qmd);
}
}
else if (annName.equals(JPAAnnotationUtils.NAMED_NATIVE_QUERY))
{
if (namedQueries == null)
{
namedQueries = new HashSet<QueryMetaData>();
}
Class resultClass = (Class)annotationValues.get("resultClass");
String resultClassName = null;
if (resultClass != null && resultClass != void.class)
{
resultClassName = resultClass.getName();
}
String resultMappingName = (String)annotationValues.get("resultSetMapping");
if (StringUtils.isWhitespace(resultMappingName))
{
resultMappingName = null;
}
QueryMetaData qmd = new QueryMetaData(cmd, null, (String)annotationValues.get("name"),
QueryLanguage.SQL.toString(), "true", resultClassName, resultMappingName, null, null);
qmd.setQuery((String)annotationValues.get("query"));
namedQueries.add(qmd);
}
else if (annName.equals(JPAAnnotationUtils.SQL_RESULTSET_MAPPINGS))
{
SqlResultSetMapping[] mappings = (SqlResultSetMapping[])annotationValues.get("value");