Methods Summary |
---|
public java.util.List | getCascadeTypes()INTERNAL: (Overridden in XMLManyToManyAccessor)
return getCascadeTypes(m_manyToMany.cascade());
|
public java.lang.String | getFetchType()INTERNAL: (Overridden in XMLManyToManyAccessor)
return m_manyToMany.fetch().name();
|
protected java.lang.String | getLoggingContext()INTERNAL:
Return the logging context for this accessor.
return m_logger.MANY_TO_MANY_MAPPING_REFERENCE_CLASS;
|
public java.lang.String | getMappedBy()INTERNAL: (Overridden in XMLManyToManyAccessor)
return m_manyToMany.mappedBy();
|
public java.lang.Class | getTargetEntity()INTERNAL: (Overridden in XMLManyToManyAccessor)
return m_manyToMany.targetEntity();
|
public boolean | isManyToMany()INTERNAL:
return true;
|
public void | process()INTERNAL:
Process a @ManyToMany or many-to-many element into a TopLink MnayToMany
mapping.
// Create a M-M mapping and process common collection mapping metadata.
ManyToManyMapping mapping = new ManyToManyMapping();
process(mapping);
if (getMappedBy().equals("")) {
// Processing the owning side of a M-M that is process a join table.
processJoinTable(getJoinTable(), mapping);
} else {
// We are processing the a non-owning side of a M-M. Must set the
// mapping read-only.
mapping.setIsReadOnly(true);
// Get the owning mapping from the reference descriptor metadata.
ManyToManyMapping ownerMapping = null;
if (getOwningMapping().isManyToManyMapping()){
ownerMapping = (ManyToManyMapping)getOwningMapping();
} else {
// If improper mapping encountered, throw an exception.
getValidator().throwInvalidMappingEncountered(getJavaClass(), getReferenceClass());
}
// Set the relation table name from the owner.
mapping.setRelationTableName(ownerMapping.getRelationTableQualifiedName());
// Add all the source foreign keys we found on the owner.
mapping.setSourceKeyFields(ownerMapping.getTargetKeyFields());
mapping.setSourceRelationKeyFields(ownerMapping.getTargetRelationKeyFields());
// Add all the target foreign keys we found on the owner.
mapping.setTargetKeyFields(ownerMapping.getSourceKeyFields());
mapping.setTargetRelationKeyFields(ownerMapping.getSourceRelationKeyFields());
}
// Add the mapping to the descriptor.
m_descriptor.addMapping(mapping);
|