{
Collection result = new ArrayList();
for (final Iterator iterator = this.getAssociationEnds().iterator(); iterator.hasNext();)
{
EJBAssociationEndFacade associationEnd = (EJBAssociationEndFacade)iterator.next();
ClassifierFacade target = associationEnd.getOtherEnd().getType();
if (target instanceof EJBEntityFacade && associationEnd.getOtherEnd().isNavigable())
{
// Check the integrity constraint
Object value =
associationEnd.getOtherEnd().getAssociation().findTaggedValue(EJBProfile.TAGGEDVALUE_GENERATE_CMR);
String generateCmr = value == null ? null : value.toString();
if (target.isAbstract() && !"false".equalsIgnoreCase(generateCmr))
{
throw new IllegalStateException("Relation '" + associationEnd.getAssociation().getName() +
"' has the abstract target '" + target.getName() +
"'. Abstract targets are not allowed in EJB.");
}
result.add(associationEnd);
}
}