*/
private void createKeyGenDescriptors(final MappingRoot mapping)
throws MappingException {
Enumeration enumeration = mapping.enumerateKeyGeneratorDef();
while (enumeration.hasMoreElements()) {
KeyGeneratorDef def = (KeyGeneratorDef) enumeration.nextElement();
// resolve name of the key generator definition; if there's an alias
// defined, use it; if not, fall back to the name attribute (this
// is to ensure that for one key generator type (e.g. HIGH-LOW), it is
// possible to define more than one instance with individual
// configuration(s).
String name = def.getAlias();
if (name == null) {
name = def.getName();
}
KeyGeneratorDescriptor desc = _keyGeneratorDescriptors.get(name);
if (desc != null) {
throw new MappingException(Messages.format("mapping.dupKeyGen", name));
}
Properties params = new Properties();
Enumeration enumerateParam = def.enumerateParam();
while (enumerateParam.hasMoreElements()) {
Param par = (Param) enumerateParam.nextElement();
params.put(par.getName(), par.getValue());
}
desc = new KeyGeneratorDescriptor(
name, def.getName(), params, _keyGenReg);
_keyGeneratorDescriptors.put(name, desc);
}
}