Set indices = super.getExpectedIndices(clr);
// Check owner for specified indices
if (mmd.getIndexMetaData() != null)
{
Index index = TableUtils.getIndexForField(this, mmd.getIndexMetaData(), ownerMapping);
if (index != null)
{
indices.add(index);
}
}
else if (mmd.getJoinMetaData() != null && mmd.getJoinMetaData().getIndexMetaData() != null)
{
Index index = TableUtils.getIndexForField(this, mmd.getJoinMetaData().getIndexMetaData(), ownerMapping);
if (index != null)
{
indices.add(index);
}
}
// Check element for specified indices
if (elementMapping instanceof EmbeddedElementPCMapping)
{
// Add all indices required by fields of the embedded element
EmbeddedElementPCMapping embMapping = (EmbeddedElementPCMapping)elementMapping;
for (int i=0;i<embMapping.getNumberOfJavaTypeMappings();i++)
{
// Add indexes for fields of this embedded PC object
JavaTypeMapping embFieldMapping = embMapping.getJavaTypeMapping(i);
IndexMetaData imd = embFieldMapping.getMemberMetaData().getIndexMetaData();
if (imd != null)
{
Index index = TableUtils.getIndexForField(this, imd, embFieldMapping);
if (index != null)
{
indices.add(index);
}
}
}
}
else
{
ElementMetaData elemmd = mmd.getElementMetaData();
if (elemmd != null && elemmd.getIndexMetaData() != null)
{
Index index = TableUtils.getIndexForField(this, elemmd.getIndexMetaData(), elementMapping);
if (index != null)
{
indices.add(index);
}
}
}
// Check order for specified indices
if (orderMapping != null)
{
if (mmd.getOrderMetaData() != null && mmd.getOrderMetaData().getIndexMetaData() != null)
{
Index index = TableUtils.getIndexForField(this, mmd.getOrderMetaData().getIndexMetaData(), orderMapping);
if (index != null)
{
indices.add(index);
}
}