EOEntity parentEntity = entity.parentEntity();
return parentEntity != null && entity.externalName() != null && entity.externalName().equalsIgnoreCase(parentEntity.externalName());
}
protected void createLocalizedAttributes(EOEntity entity) {
NSArray attributes = entity.attributes().immutableClone();
NSArray classProperties = entity.classProperties().immutableClone();
NSArray attributesUsedForLocking = entity.attributesUsedForLocking().immutableClone();
if (attributes == null) {
attributes = NSArray.EmptyArray;
}
if (classProperties == null) {
classProperties = NSArray.EmptyArray;
}
if (attributesUsedForLocking == null) {
attributesUsedForLocking = NSArray.EmptyArray;
}
NSMutableArray mutableClassProperties = classProperties.mutableClone();
NSMutableArray mutableAttributesUsedForLocking = attributesUsedForLocking.mutableClone();
for (Enumeration e = attributes.objectEnumerator(); e.hasMoreElements();) {
EOAttribute attribute = (EOAttribute) e.nextElement();
NSDictionary userInfo = attribute.userInfo();
String name = attribute.name();
if (userInfo != null) {
Object l = userInfo.valueForKey("ERXLanguages");
if (l != null && !(l instanceof NSArray)) {
l = (entity.model().userInfo() != null ? entity.model().userInfo().valueForKey("ERXLanguages") : null);
}
NSArray languages = (NSArray) l;
if (languages != null && languages.count() > 0) {
String columnName = attribute.columnName();
for (int i = 0; i < languages.count(); i++) {
String language = (String) languages.objectAtIndex(i);
String newName = name + "_" + language;
String newColumnName = columnName + "_" + language;
EOAttribute newAttribute = new EOAttribute();
newAttribute.setName(newName);