// find / create metadata
ClassMetaData meta = (m == null) ? getMetaData() : m;
if (meta == null)
return null;
Entity entity = _cls.getAnnotation(Entity.class);
MappedSuperclass mapped = _cls.getAnnotation(MappedSuperclass.class);
Embeddable embeddable = _cls.getAnnotation(Embeddable.class);
if (isMetaDataMode()) {
meta.setAbstract(mapped != null);
if (embeddable != null) meta.setEmbeddable();
// while the spec only provides for embedded exclusive, it doesn't
// seem hard to support otherwise
if (entity == null)
meta.setEmbeddedOnly(true);
else {
meta.setEmbeddedOnly(false);
if (!StringUtils.isEmpty(entity.name()))
meta.setTypeAlias(entity.name());
}
}
// track fetch groups to parse them after fields, since they
// rely on field metadata