{
if (baseMapping.m_typeCodeAttribute != null)
{
if (m_typeCodeAttribute.getOrdinal() != baseMapping.m_typeCodeAttribute.getOrdinal())
{
throw new MetadataException("err.meta.typeCodeAttrMismatch",
new Object[]{m_metaclass.getName(), m_metaclass.getBase().getName()});
}
if (baseMapping.m_bTypeCodeForced)
{
m_bTypeCodeForced = true;
}
}
if (baseMapping.m_lockingAttribute != null)
{
if (m_lockingAttribute.getOrdinal() != baseMapping.m_lockingAttribute.getOrdinal())
{
throw new MetadataException("err.meta.lockingAttrMismatch",
new Object[]{m_metaclass.getName(), m_metaclass.getBase().getName()});
}
}
}
// Validate the type code attribute
if (m_typeCodeAttribute != null)
{
if (getAttributeMapping(m_typeCodeAttribute) == null)
{
throw new MetadataException("err.meta.unmappedTypeCodeAttr",
new Object[]{m_typeCodeAttribute.getName(), m_metaclass.getName()});
}
Object typeCode = m_typeCodeAttribute.getValue();
if (typeCode != Undefined.VALUE)
{
if (typeCode == null || Primitive.primitiveOf(typeCode) == Primitive.ANY)
{
MetadataValidationException e = new MetadataValidationException(
"err.meta.typeCodeValue", new Object[]{m_typeCodeAttribute.getName(), m_metaclass.getName()});
m_typeCodeAttribute.setProperties(e);
throw e;
}
typeCode = ((Primitive)m_typeCodeAttribute.getType()).convert(typeCode);
}
try
{
if (typeCode != Undefined.VALUE)
{
addTypeCode(typeCode, m_metaclass);
}
for (; baseMapping != null; baseMapping = baseMapping.getBaseMapping())
{
if (baseMapping.m_dataSource != m_dataSource ||
baseMapping.m_typeCodeAttribute == null)
{
break;
}
if (!m_bTypeCodeFiltered)
{
if (baseMapping.m_typeCodeAttribute.getValue() != Undefined.VALUE ||
baseMapping.getMetaclass().getDerivedCount() != 1)
{
m_bTypeCodeFiltered = true;
}
}
if (typeCode != Undefined.VALUE)
{
baseMapping.addTypeCode(typeCode, m_metaclass);
baseMapping.m_bTypeCodeDispatched = true;
}
}
}
catch (UncheckedException x)
{
MetadataValidationException e = new MetadataValidationException(x);
m_typeCodeAttribute.setProperties(e);
throw e;
}
if (!m_bTypeCodeFiltered)
{
if (m_bTypeCodeForced || getAttributeMapping(m_typeCodeAttribute).isMultiplexed())
{
m_bTypeCodeFiltered = true;
}
}
}
// Validate the locking attribute
if (m_lockingAttribute != null)
{
if (getAttributeMapping(m_lockingAttribute) == null)
{
throw new MetadataException("err.meta.unmappedLockingAttribute",
new Object[]{m_lockingAttribute.getName(), m_metaclass.getName()});
}
}
}