FileDocCategorySizeDatePackage
RelationshipDescriptor.javaAPI DocGlassfish v2 API4310Fri May 04 22:31:22 BST 2007com.sun.enterprise.deployment

RelationshipDescriptor

public final class RelationshipDescriptor extends Descriptor
This class contains information about relationships between EJB2.0 CMP EntityBeans. It represents information in the XML element.
author
Sanjeev Krishnan

Fields Summary
private static com.sun.enterprise.util.LocalStringManagerImpl
localStrings
private RelationRoleDescriptor
source
private RelationRoleDescriptor
sink
private boolean
isBidirectional
Constructors Summary
public RelationshipDescriptor()

    
      
    
Methods Summary
public booleangetIsBidirectional()

	return isBidirectional;
    
public RelationRoleDescriptorgetSink()

	return sink;
    
public RelationRoleDescriptorgetSource()

  
	return source;  
    
public booleanhasParticipant(Descriptor desc)
Checks whether an EjbCMPEntityDescriptor is a participant in this relationship.

        return ( (source.getOwner() == desc) || (sink.getOwner() == desc) );
    
public booleanisManyMany()

	return (source.getIsMany() && sink.getIsMany()); 
    
public booleanisManyOne()

	return (source.getIsMany() && !sink.getIsMany()); 
    
public booleanisOneMany()

	return (!source.getIsMany() && sink.getIsMany()); 
    
public booleanisOneOne()

	return (!source.getIsMany() && !sink.getIsMany()); 
    
public voidprint(java.lang.StringBuffer toStringBuffer)

        toStringBuffer.append("From EJB ").append(getSource().getName()
           ).append(" cmr field : ").append(getSource().getCMRField()
           ).append("(").append(getSource().getCMRFieldType()).append(")  to EJB ").append(getSink().getName()
           ).append(" isMany ").append(getSource().getIsMany()
           ).append(" cascade-delete ").append(getSource().getCascadeDelete());
    
public voidsetIsBidirectional(boolean isBidirectional)

	this.isBidirectional = isBidirectional;
    
public voidsetSink(RelationRoleDescriptor sink)

	this.sink = sink;
    
public voidsetSource(RelationRoleDescriptor source)

  
	this.source = source;