m_fetch = (annotation == null) ? getDefaultFetchType() : (String) annotation.getAttribute("fetch");
m_targetEntity = getMetadataClass((annotation == null) ? "void" : (String) annotation.getAttributeString("targetEntity"));
m_cascadeTypes = (annotation == null) ? null : new CascadeTypes((Object[]) annotation.getAttributeArray("cascade"), accessibleObject);
// Set the join fetch if one is present.
MetadataAnnotation joinFetch = getAnnotation(JoinFetch.class);
if (joinFetch != null) {
m_joinFetch = (String) joinFetch.getAttribute("value");
// If the value is null a value still must be set, otherwise it will not be known to be there.
if (m_joinFetch == null) {
m_joinFetch = "";
}
}
// Set the private owned if one is present.
m_privateOwned = isAnnotationPresent(PrivateOwned.class);
// Set the join columns if some are present.
// Process all the join columns first.
MetadataAnnotation joinColumns = getAnnotation(JoinColumns.class);
if (joinColumns != null) {
for (Object jColumn : (Object[]) joinColumns.getAttributeArray("value")) {
m_joinColumns.add(new JoinColumnMetadata((MetadataAnnotation)jColumn, accessibleObject));
}
}
// Process the single key join column second.
MetadataAnnotation joinColumn = getAnnotation(JoinColumn.class);
if (joinColumn != null) {
m_joinColumns.add(new JoinColumnMetadata(joinColumn, accessibleObject));
}
// Set the join table if one is present.