}
//Iterator over each konwn class to apply property if the pattern match
for (int i = 0; i < classNames.length; i++) {
if (prop.patternOnField) {
//Fetch list of fields belong the class
HomeItf sh = (HomeItf) mapper.lookup(classNames[i]);
//TODO: provide in HomeItf (PClassMapping maybe) a new method
// returning the list of persistent field.
String[] fieldNames = new String[0]; //sh.get ...
for (int j = 0; j < fieldNames.length; j++) {
//build the path from the class name and the field name
String path = classNames[i] + FIELD_SEP + fieldNames[j];
if (prop.match(path)) {
//The path matches
HomeItf subHome;
try {
//Try to find the home of the gen clas if the field
// corresponds to a genclass reference
subHome = (HomeItf) sh.getGenClassMapping(fieldNames[i]);
} catch (UnsupportedOperationException e) {
//The field is not a reference to gen class
subHome = sh;
}
//apply the property on the home
prop.applyProperty(subHome);
}
}
} else if (prop.match(classNames[i])) {
//the property is not for a field and matches to the class name
String path = classNames[i];
//find the home corresponding to the class name
HomeItf sh = (HomeItf) mapper.lookup(path);
//apply the property on the home
prop.applyProperty(sh);
}
}
}