// Nothing to add at this point
}
else if (localName.equals("entity-listener"))
{
MetaData md = getStack();
EventListenerMetaData elmd = new EventListenerMetaData(getAttr(attrs, "class"));
if (md instanceof AbstractClassMetaData)
{
// Specified at <entity> or <mapped-superclass>
((AbstractClassMetaData)md).addListener(elmd);
}
else if (md instanceof FileMetaData)
{
// Specified at <persistence-unit-defaults>
((FileMetaData)md).addListener(elmd);
}
pushStack(elmd);
}
else if (localName.equals("pre-persist"))
{
// Pre-create callback
MetaData md = getStack();
if (md instanceof AbstractClassMetaData)
{
// Specified at <entity> or <mapped-superclass>
AbstractClassMetaData cmd = (AbstractClassMetaData)md;
EventListenerMetaData elmd = cmd.getListenerForClass(cmd.getFullClassName());
if (elmd == null)
{
elmd = new EventListenerMetaData(cmd.getFullClassName());
cmd.addListener(elmd);
}
elmd.addCallback("javax.persistence.PrePersist", getAttr(attrs, "method-name"));
}
else
{
// Specified at <entity-listener>
EventListenerMetaData elmd = (EventListenerMetaData)md;
elmd.addCallback("javax.persistence.PrePersist", getAttr(attrs, "method-name"));
}
}
else if (localName.equals("post-persist"))
{
// Post-create callback
MetaData md = getStack();
if (md instanceof AbstractClassMetaData)
{
// Specified at <entity> or <mapped-superclass>
AbstractClassMetaData cmd = (AbstractClassMetaData)md;
EventListenerMetaData elmd = cmd.getListenerForClass(cmd.getFullClassName());
if (elmd == null)
{
elmd = new EventListenerMetaData(cmd.getFullClassName());
cmd.addListener(elmd);
}
elmd.addCallback("javax.persistence.PostPersist", getAttr(attrs, "method-name"));
}
else
{
// Specified at <entity-listener>
EventListenerMetaData elmd = (EventListenerMetaData)md;
elmd.addCallback("javax.persistence.PostPersist", getAttr(attrs, "method-name"));
}
}
else if (localName.equals("pre-remove"))
{
// Pre-delete callback
MetaData md = getStack();
if (md instanceof AbstractClassMetaData)
{
// Specified at <entity> or <mapped-superclass>
AbstractClassMetaData cmd = (AbstractClassMetaData)md;
EventListenerMetaData elmd = cmd.getListenerForClass(cmd.getFullClassName());
if (elmd == null)
{
elmd = new EventListenerMetaData(cmd.getFullClassName());
cmd.addListener(elmd);
}
elmd.addCallback("javax.persistence.PreRemove", getAttr(attrs, "method-name"));
}
else
{
// Specified at <entity-listener>
EventListenerMetaData elmd = (EventListenerMetaData)md;
elmd.addCallback("javax.persistence.PreRemove", getAttr(attrs, "method-name"));
}
}
else if (localName.equals("post-remove"))
{
// Post-delete callback
MetaData md = getStack();
if (md instanceof AbstractClassMetaData)
{
// Specified at <entity> or <mapped-superclass>
AbstractClassMetaData cmd = (AbstractClassMetaData)md;
EventListenerMetaData elmd = cmd.getListenerForClass(cmd.getFullClassName());
if (elmd == null)
{
elmd = new EventListenerMetaData(cmd.getFullClassName());
cmd.addListener(elmd);
}
elmd.addCallback("javax.persistence.PostRemove", getAttr(attrs, "method-name"));
}
else
{
// Specified at <entity-listener>
EventListenerMetaData elmd = (EventListenerMetaData)md;
elmd.addCallback("javax.persistence.PostRemove", getAttr(attrs, "method-name"));
}
}
else if (localName.equals("pre-update"))
{
// Pre-store callback
MetaData md = getStack();
if (md instanceof AbstractClassMetaData)
{
// Specified at <entity> or <mapped-superclass>
AbstractClassMetaData cmd = (AbstractClassMetaData)md;
EventListenerMetaData elmd = cmd.getListenerForClass(cmd.getFullClassName());
if (elmd == null)
{
elmd = new EventListenerMetaData(cmd.getFullClassName());
cmd.addListener(elmd);
}
elmd.addCallback("javax.persistence.PreUpdate", getAttr(attrs, "method-name"));
}
else
{
// Specified at <entity-listener>
EventListenerMetaData elmd = (EventListenerMetaData)md;
elmd.addCallback("javax.persistence.PreUpdate", getAttr(attrs, "method-name"));
}
}
else if (localName.equals("post-update"))
{
// Post-store callback
MetaData md = getStack();
if (md instanceof AbstractClassMetaData)
{
// Specified at <entity> or <mapped-superclass>
AbstractClassMetaData cmd = (AbstractClassMetaData)md;
EventListenerMetaData elmd = cmd.getListenerForClass(cmd.getFullClassName());
if (elmd == null)
{
elmd = new EventListenerMetaData(cmd.getFullClassName());
cmd.addListener(elmd);
}
elmd.addCallback("javax.persistence.PostUpdate", getAttr(attrs, "method-name"));
}
else
{
// Specified at <entity-listener>
EventListenerMetaData elmd = (EventListenerMetaData)md;
elmd.addCallback("javax.persistence.PostUpdate", getAttr(attrs, "method-name"));
}
}
else if (localName.equals("post-load"))
{
// Post-load callback
MetaData md = getStack();
if (md instanceof AbstractClassMetaData)
{
// Specified at <entity> or <mapped-superclass>
AbstractClassMetaData cmd = (AbstractClassMetaData)md;
EventListenerMetaData elmd = cmd.getListenerForClass(cmd.getFullClassName());
if (elmd == null)
{
elmd = new EventListenerMetaData(cmd.getFullClassName());
cmd.addListener(elmd);
}
elmd.addCallback("javax.persistence.PostLoad", getAttr(attrs, "method-name"));
}
else
{
// Specified at <entity-listener>
EventListenerMetaData elmd = (EventListenerMetaData)md;
elmd.addCallback("javax.persistence.PostLoad", getAttr(attrs, "method-name"));
}
}
else if (localName.equals("attribute-override"))
{
// Override columns for a superclass field