pushStack(cmd);
}
else if (localName.equals("interface"))
{
PackageMetaData pmd = (PackageMetaData)getStack();
InterfaceMetaData imd = newInterfaceObject(pmd, attrs);
pmd.addInterface(imd);
pushStack(imd);
}
else if (localName.equals("primary-key"))
{
MetaData md = getStack();
PrimaryKeyMetaData pkmd = new PrimaryKeyMetaData();
pkmd.setName(getAttr(attrs,"name"));
pkmd.setColumnName(getAttr(attrs, "column"));
if (md instanceof AbstractClassMetaData)
{
((AbstractClassMetaData)md).setPrimaryKeyMetaData(pkmd);
}
else if (md instanceof JoinMetaData)
{
((JoinMetaData)md).setPrimaryKeyMetaData(pkmd);
}
pushStack(pkmd);
}
else if (localName.equals("implements"))
{
ClassMetaData cmd = (ClassMetaData)getStack();
ImplementsMetaData imd = new ImplementsMetaData(getAttr(attrs,"name"));
cmd.addImplements(imd);
pushStack(imd);
}
else if (localName.equals("property"))
{
MetaData parent = getStack();
if (parent instanceof AbstractClassMetaData)
{
AbstractClassMetaData acmd = (AbstractClassMetaData)parent;
PropertyMetaData propmd = newPropertyObject(acmd, attrs);
acmd.addMember(propmd);
pushStack(propmd);
}
else if (parent instanceof EmbeddedMetaData)
{
EmbeddedMetaData emd = (EmbeddedMetaData)parent;
PropertyMetaData propmd = newPropertyObject(emd, attrs);
emd.addMember(propmd);
pushStack(propmd);
}
else if (parent instanceof ImplementsMetaData)
{
ImplementsMetaData implmd = (ImplementsMetaData)parent;
PropertyMetaData propmd = newPropertyObject(implmd, attrs);
implmd.addProperty(propmd);
pushStack(propmd);
}
else if (parent instanceof FetchGroupMetaData)
{
FetchGroupMetaData fgmd = (FetchGroupMetaData)parent;
PropertyMetaData propmd = newPropertyObject(fgmd, attrs);
fgmd.addMember(propmd);
pushStack(propmd);
}
}
else if (localName.equals("datastore-identity"))
{
AbstractClassMetaData acmd = (AbstractClassMetaData)getStack();
IdentityMetaData idmd = new IdentityMetaData();
idmd.setColumnName(getAttr(attrs,"column"));
idmd.setValueStrategy(IdentityStrategy.getIdentityStrategy(getAttr(attrs,"strategy")));
idmd.setSequence(getAttr(attrs,"sequence"));
acmd.setIdentityMetaData(idmd);
pushStack(idmd);
}
else if (localName.equals("inheritance"))
{
MetaData parent = getStack();
AbstractClassMetaData acmd = (AbstractClassMetaData)parent;
InheritanceMetaData inhmd = new InheritanceMetaData();
inhmd.setStrategy(getAttr(attrs,"strategy"));
acmd.setInheritanceMetaData(inhmd);
pushStack(inhmd);
}
else if (localName.equals("discriminator"))
{
InheritanceMetaData inhmd = (InheritanceMetaData)getStack();
DiscriminatorMetaData dismd = inhmd.newDiscriminatorMetadata();
dismd.setColumnName(getAttr(attrs,"column"));
dismd.setValue(getAttr(attrs,"value"));
dismd.setStrategy(getAttr(attrs,"strategy"));
dismd.setIndexed(getAttr(attrs,"indexed"));
pushStack(dismd);
}
else if (localName.equals("query"))
{
MetaData emd = getStack();
if (emd instanceof ClassMetaData)
{
ClassMetaData cmd = (ClassMetaData)emd;
QueryMetaData qmd = new QueryMetaData(getAttr(attrs, "name"));
qmd.setScope(cmd.getFullClassName());
qmd.setLanguage(getAttr(attrs, "language"));
qmd.setUnmodifiable(getAttr(attrs, "unmodifiable"));
qmd.setResultClass(getAttr(attrs, "result-class"));
qmd.setUnique(getAttr(attrs, "unique"));
qmd.setFetchPlanName(getAttr(attrs, "fetch-plan"));
cmd.addQuery(qmd);
pushStack(qmd);
}
else if (emd instanceof InterfaceMetaData)
{
InterfaceMetaData imd = (InterfaceMetaData)emd;
QueryMetaData qmd = new QueryMetaData(getAttr(attrs, "name"));
qmd.setScope(imd.getFullClassName());
qmd.setLanguage(getAttr(attrs, "language"));
qmd.setUnmodifiable(getAttr(attrs, "unmodifiable"));
qmd.setResultClass(getAttr(attrs, "result-class"));
qmd.setUnique(getAttr(attrs, "unique"));
qmd.setFetchPlanName(getAttr(attrs, "fetch-plan"));
imd.addQuery(qmd);
pushStack(qmd);
}
else if (emd instanceof FileMetaData)
{
FileMetaData filemd = (FileMetaData)emd;
QueryMetaData qmd = filemd.newQueryMetadata(getAttr(attrs, "name"));
qmd.setLanguage(getAttr(attrs, "language"));
qmd.setUnmodifiable(getAttr(attrs, "unmodifiable"));
qmd.setResultClass(getAttr(attrs, "result-class"));
qmd.setUnique(getAttr(attrs, "unique"));
qmd.setFetchPlanName(getAttr(attrs, "fetch-plan"));
pushStack(qmd);
}
}
else if (localName.equals("sequence"))
{
PackageMetaData pmd = (PackageMetaData)getStack();
SequenceMetaData seqmd =
pmd.newSequenceMetadata(getAttr(attrs,"name"), getAttr(attrs,"strategy"));
seqmd.setFactoryClass(getAttr(attrs,"factory-class"));
seqmd.setDatastoreSequence(getAttr(attrs,"datastore-sequence"));
String seqSize = getAttr(attrs, "allocation-size");
if (seqSize != null)
{
seqmd.setAllocationSize(seqSize);
}
String seqStart = getAttr(attrs, "initial-value");
if (seqStart != null)
{
seqmd.setInitialValue(seqStart);
}
pushStack(seqmd);
}
else if (localName.equals("field"))
{
MetaData md = getStack();
FieldMetaData fmd = newFieldObject(md,attrs);
if (md instanceof ClassMetaData)
{
ClassMetaData cmd = (ClassMetaData)md;
cmd.addMember(fmd);
}
else if (md instanceof FetchGroupMetaData)
{
FetchGroupMetaData fgmd = (FetchGroupMetaData)md;
fgmd.addMember(fmd);
}
else if (md instanceof EmbeddedMetaData)
{
EmbeddedMetaData emd = (EmbeddedMetaData)md;
emd.addMember(fmd);
}
else if (md instanceof ForeignKeyMetaData)
{
ForeignKeyMetaData fkmd = (ForeignKeyMetaData)md;
fkmd.addMember(fmd);
}
else if (md instanceof IndexMetaData)
{
IndexMetaData imd = (IndexMetaData)md;
imd.addMember(fmd);
}
else if (md instanceof UniqueMetaData)
{
UniqueMetaData umd = (UniqueMetaData)md;
umd.addMember(fmd);