}
Class pclassJorm = manager.getClass(sc.getFQName());
pName = getClassNameDef(pclassJorm);
if (classJorm == null) {
throw new SpeedoXMLError("Class '" + clas.name + "' not defined in JORM metadata");
}
// Comparison from JDO
clas.jormclass = classJorm;
for (Iterator efield = clas.fields.values().iterator(); efield.hasNext();) {
SpeedoField field = (SpeedoField) efield.next();
String fieldName = field.name;
// Fields with this persistent modifier shouldn't stay in JDO Metadata
if (field.persistenceStatus == SpeedoField.NONE)
continue;
TypedElement tElem = classJorm.getTypedElement(fieldName);
if (tElem == null) {
throw new SpeedoXMLError("Field '" + fieldName
+ "' not defined in JORM metadata of the class '"
+ clas.getFQName() + "'");
}
// for application identity key fields have to be compared
if (field.primaryKey) {
boolean found = false;
for (Iterator it = pName.iterateField(); it.hasNext() && !found;) {
found = fieldName.equals(it.next());
}
if (!found) {
throw new SpeedoXMLError("Field '" + fieldName
+ "' not defined in Class NameDef's Fields of the class '"
+ clas.getFQName() + "'");
}
}
if (tElem instanceof GenClassRef && field.jdoTuple == null)
throw new SpeedoXMLError("field '" + fieldName + "' should be a tuple in JDO metadata of the class '" + clas.getFQName() + "'");
}
// Comparison from JORM
for (Iterator jormfield = classJorm.getFields().iterator(); jormfield.hasNext();) {
TypedElement te = (TypedElement) jormfield.next();
String fieldName = te.getName();
if (!clas.fields.containsKey(fieldName)
&& !isContainerIdField(classJorm, te, clas))
throw new SpeedoXMLError("Field '" + fieldName + "' of the class '"
+ clas.getFQName() + "' is not defined in the '"
+ clas.moPackage.xmlDescriptor.xmlFile
+ "' file (found: " + clas.fields.keySet() + ").");
}