return exprFactory.newLiteral(stmt, m, false).eq(exprFactory.newLiteral(stmt, m, true));
}
else if (mapping instanceof ReferenceMapping)
{
// This expression will be for the table containing the reference so need to join now
ReferenceMapping refMapping = (ReferenceMapping)mapping;
if (refMapping.getMappingStrategy() != ReferenceMapping.PER_IMPLEMENTATION_MAPPING)
{
throw new NucleusUserException("Impossible to do cast of interface to " + type.getName() +
" since interface is persisted as embedded String." +
" Use per-implementation mapping to allow this query");
}
JavaTypeMapping[] implMappings = refMapping.getJavaTypeMapping();
for (int i=0;i<implMappings.length;i++)
{
Class implType = clr.classForName(implMappings[i].getType());
if (type.isAssignableFrom(implType))
{