resultMappings = new ArrayList<QueryResultMetaData>();
}
for (int j=0;j<mappings.length;j++)
{
QueryResultMetaData qrmd = new QueryResultMetaData(cmd, mappings[j].name());
EntityResult[] entityResults = (EntityResult[])mappings[j].entities();
if (entityResults != null)
{
for (int k=0;k<entityResults.length;k++)
{
String entityClassName = entityResults[k].entityClass().getName();
qrmd.addPersistentTypeMapping(entityClassName, null,
entityResults[k].discriminatorColumn());
FieldResult[] fields = entityResults[k].fields();
if (fields != null)
{
for (int l=0;l<fields.length;l++)
{
qrmd.addMappingForPersistentTypeMapping(entityClassName, fields[l].name(), fields[l].column());
}
}
}
}
ColumnResult[] colResults = (ColumnResult[])mappings[j].columns();
if (colResults != null)
{
for (int k=0;k<colResults.length;k++)
{
qrmd.addScalarColumn(colResults[k].name());
}
}
resultMappings.add(qrmd);
}
}
else if (annName.equals(JPAAnnotationUtils.SQL_RESULTSET_MAPPING))
{
if (resultMappings == null)
{
resultMappings = new ArrayList<QueryResultMetaData>();
}
QueryResultMetaData qrmd = new QueryResultMetaData(cmd, (String)annotationValues.get("name"));
EntityResult[] entityResults = (EntityResult[])annotationValues.get("entities");
if (entityResults != null)
{
for (int j=0;j<entityResults.length;j++)
{
String entityClassName = entityResults[j].entityClass().getName();
qrmd.addPersistentTypeMapping(entityClassName, null,
entityResults[j].discriminatorColumn());
FieldResult[] fields = entityResults[j].fields();
if (fields != null)
{
for (int k=0;k<fields.length;k++)
{
qrmd.addMappingForPersistentTypeMapping(entityClassName, fields[k].name(), fields[k].column());
}
}
}
}
ColumnResult[] colResults = (ColumnResult[])annotationValues.get("columns");
if (colResults != null)
{
for (int j=0;j<colResults.length;j++)
{
qrmd.addScalarColumn(colResults[j].name());
}
}
resultMappings.add(qrmd);
}
else if (annName.equals(JPAAnnotationUtils.SECONDARY_TABLES))