log.trace(_loc.get("parse-gen", name));
if (getRepository().getCachedSequenceMetaData(name) != null
&& log.isWarnEnabled())
log.warn(_loc.get("override-gen", name));
SequenceMapping seq = (SequenceMapping) getRepository().
addSequenceMetaData(name);
seq.setSequencePlugin(SequenceMapping.IMPL_VALUE_TABLE);
seq.setTableIdentifier(toTableIdentifier(attrs.getValue("schema"),
attrs.getValue("table")));
seq.setPrimaryKeyColumnIdentifier(DBIdentifier.newColumn(attrs.getValue("pk-column-name"), delimit()));
seq.setSequenceColumnIdentifier(DBIdentifier.newColumn(attrs.getValue("value-column-name"), delimit()));
seq.setPrimaryKeyValue(attrs.getValue("pk-column-value"));
String val = attrs.getValue("initial-value");
if (val != null)
seq.setInitialValue(Integer.parseInt(val));
val = attrs.getValue("allocation-size");
if (val != null)
seq.setAllocate(Integer.parseInt(val));
Object cur = currentElement();
Object scope = (cur instanceof ClassMetaData)
? ((ClassMetaData) cur).getDescribedType() : null;
seq.setSource(getSourceFile(), scope, SourceTracker.SRC_XML);
Locator locator = getLocation().getLocator();
if (locator != null) {
seq.setLineNumber(locator.getLineNumber());
seq.setColNumber(locator.getColumnNumber());
}
pushElement(seq);
return true;
}