}
// New interface for this package
else if (localName.equals("interface"))
{
PackageMetaData pmd = (PackageMetaData)getStack();
InterfaceMetaData imd = mgr.getMetaDataFactory().newInterfaceObject(pmd,
getAttr(attrs, "name"),
getAttr(attrs, "identity-type"),
getAttr(attrs, "objectid-class"),
getAttr(attrs, "requires-extent"),
getAttr(attrs, "detachable"),
getAttr(attrs, "embedded-only"),
getAttr(attrs, "catalog"),
getAttr(attrs, "schema"),
getAttr(attrs, "table"),
null);
pmd.addInterface(imd);
pushStack(imd);
}
// New primary-key for class/interface
else if (localName.equals("primary-key"))
{
MetaData md = getStack();
PrimaryKeyMetaData pkmd =
new PrimaryKeyMetaData(md, getAttr(attrs,"name"), getAttr(attrs, "column"));
if (md instanceof AbstractClassMetaData)
{
((AbstractClassMetaData)md).setPrimaryKeyMetaData(pkmd);
}
else if (md instanceof JoinMetaData)
{
((JoinMetaData)md).setPrimaryKeyMetaData(pkmd);
}
pushStack(pkmd);
}
// New implements for this class
else if (localName.equals("implements"))
{
ClassMetaData cmd = (ClassMetaData)getStack();
ImplementsMetaData imd =
new ImplementsMetaData(cmd, getAttr(attrs,"name"));
cmd.addImplements(imd);
pushStack(imd);
}
// New property for this interface
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);
}
}
// New datastore-identity for this class
else if (localName.equals("datastore-identity"))
{
AbstractClassMetaData acmd = (AbstractClassMetaData)getStack();
IdentityMetaData imd = new IdentityMetaData(acmd,
getAttr(attrs,"column"),
getAttr(attrs,"strategy"),
getAttr(attrs,"sequence"));
acmd.setIdentityMetaData(imd);
pushStack(imd);
}
// New inheritance for this class
else if (localName.equals("inheritance"))
{
MetaData parent = getStack();
AbstractClassMetaData acmd = (AbstractClassMetaData)parent;
InheritanceMetaData imd = new InheritanceMetaData(acmd,
getAttr(attrs,"strategy"));
acmd.setInheritanceMetaData(imd);
pushStack(imd);
}
// Discriminator for this inheritance
else if (localName.equals("discriminator"))
{
InheritanceMetaData imd = (InheritanceMetaData)getStack();
DiscriminatorMetaData dismd = new DiscriminatorMetaData(imd,
getAttr(attrs,"column"),
getAttr(attrs,"value"),
getAttr(attrs,"strategy"),
getAttr(attrs,"indexed"));
imd.setDiscriminatorMetaData(dismd);
pushStack(dismd);
}
// New query for this class
else if (localName.equals("query"))
{
MetaData emd = getStack();
QueryMetaData qmd = new QueryMetaData(emd,
(emd instanceof ClassMetaData ? ((ClassMetaData)emd).getFullClassName() : null),
getAttr(attrs, "name"),
getAttr(attrs, "language"),
getAttr(attrs, "unmodifiable"),
getAttr(attrs, "result-class"),
null,
getAttr(attrs, "unique"),
getAttr(attrs, "fetch-plan"));
if (emd instanceof ClassMetaData)
{
ClassMetaData cmd = (ClassMetaData)emd;
cmd.addQuery(qmd);
}
else if (emd instanceof FileMetaData)
{
FileMetaData fmd = (FileMetaData)emd;
fmd.addQuery(qmd);
}
pushStack(qmd);
}
// New sequence for this class
else if (localName.equals("sequence"))
{
MetaData emd = getStack();
SequenceMetaData seqmd = new SequenceMetaData(emd,
getAttr(attrs,"name"),
getAttr(attrs,"datastore-sequence"),
getAttr(attrs,"factory-class"),
getAttr(attrs,"strategy"),
null, null);
if (emd instanceof PackageMetaData)
{
PackageMetaData pmd = (PackageMetaData)emd;
pmd.addSequence(seqmd);
}
pushStack(seqmd);
}
// New field for this class
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);
}
pushStack(fmd);
}
// New join
else if (localName.equals("join"))
{
MetaData parent = getStack();
JoinMetaData jnmd = new JoinMetaData(parent,
getAttr(attrs, "table"),
null, null,
getAttr(attrs, "column"),
getAttr(attrs, "outer"),
getAttr(attrs, "delete-action"),
getAttr(attrs, "indexed"),
getAttr(attrs, "unique"));
if (parent instanceof AbstractMemberMetaData)
{
AbstractMemberMetaData fmd = (AbstractMemberMetaData)parent;
fmd.setJoinMetaData(jnmd);
}
else if (parent instanceof AbstractClassMetaData)
{
AbstractClassMetaData cmd = (AbstractClassMetaData)parent;
cmd.addJoin(jnmd);
}
else if (parent instanceof InheritanceMetaData)
{
InheritanceMetaData imd = (InheritanceMetaData)parent;
imd.setJoinMetaData(jnmd);
}
pushStack(jnmd);
}
// New map container for this field
else if (localName.equals("map"))