// also rename the target from interface to entity
for (Entity entity : model.getEntities())
{
for (Entity iface : entity.getImplements())
{
for (Field mref : iface.getFieldsOf(new MrefField()))
{
Field f = new Field(mref);
f.setEntity(entity);
String mrefName = entity.getName() + "_" + f.getName();
if (mrefName.length() > 30)
{
mrefName = mrefName.substring(0, 25) + Integer.toString(mrefName.hashCode()).substring(0, 5);
}
f.setMrefName(mrefName);
entity.addField(0, f);
}
}
}
// remove interfaces from entities
for (Entity entity : model.getEntities())
{
if (entity.isAbstract()) for (Field mref : entity.getFieldsOf(new MrefField()))
{
entity.removeField(mref);
}
}
}