FileDocCategorySizeDatePackage
XMLBasicAccessor.javaAPI DocGlassfish v2 API8911Tue May 22 16:54:30 BST 2007oracle.toplink.essentials.internal.ejb.cmp3.xml.accessors

XMLBasicAccessor

public class XMLBasicAccessor extends BasicAccessor implements XMLAccessor
An XML extended basic accessor.
author
Guy Pelletier
since
TopLink EJB 3.0 Reference Implementation

Fields Summary
private Node
m_node
private XMLHelper
m_helper
Constructors Summary
public XMLBasicAccessor(MetadataAccessibleObject accessibleObject, Node node, XMLClassAccessor classAccessor)
INTERNAL:

        super(accessibleObject, classAccessor);
        m_node = node;
        m_helper = classAccessor.getHelper();
    
Methods Summary
public java.lang.StringgetCatalog()
INTERNAL:

        return m_descriptor.getCatalog();
    
protected oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataColumngetColumn(java.lang.String loggingCtx)
INTERNAL: (Override from BasicAccessor) Build a metadata column. If one isn't found in XML then look for an annotation.

        Node node = m_helper.getNode(m_node, XMLConstants.COLUMN);
        
        if (node != null) {
            return new XMLColumn(node, m_helper, this);
        } else {
            return super.getColumn(loggingCtx);
        }
    
public java.lang.StringgetDocumentName()
INTERNAL:

        return m_helper.getDocumentName();
    
public java.lang.StringgetEnumeratedType()
INTERNAL: (Override from DirectAccessor)

        if (hasEnumerated()) {
            return m_helper.getNodeTextValue(m_node, XMLConstants.ENUMERATED);
        } else {
            return super.getEnumeratedType();
        }
    
public java.lang.StringgetFetchType()
INTERNAL: (Override from BasicAccessor)

        return m_helper.getFetchTypeDefaultEAGER(m_node);
    
public oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLHelpergetHelper()
INTERNAL:

        return m_helper;
    
public java.lang.StringgetSchema()
INTERNAL:

        return m_descriptor.getSchema();
    
public java.lang.StringgetTemporalType()
INTERNAL: (Override from DirectAccessor) Return the temporal type for this accessor. Assumes there is a temporal node.

        if (hasTemporal()) {
            return m_helper.getNodeTextValue(m_node, XMLConstants.TEMPORAL);
        } else {
            return super.getTemporalType();
        }
    
public booleanhasEnumerated()
INTERNAL: (Override from DirectAccessor) Method to check if m_node has an enumerated sub-element.

        Node node = m_helper.getNode(m_node, XMLConstants.ENUMERATED);
        
        if (node == null) {
            return super.hasEnumerated();
        } else {
            return true;
        }
    
public booleanhasLob()
INTERNAL: (Override from DirectAccessor) Return true if this accessor represents an BLOB/CLOB mapping, i.e. has a lob sub-element.

        Node node = m_helper.getNode(m_node, XMLConstants.LOB);
        
        if (node == null) {
            return super.hasLob();
        } else {
            return true;
        }
    
public booleanhasTemporal()
INTERNAL: (Override from DirectAccessor) Method to check if m_node has a temporal sub-element.

        Node node = m_helper.getNode(m_node, XMLConstants.TEMPORAL);
        
        if (node == null) {
            return super.hasTemporal();
        } else {
            return true;
        }
    
public booleanisId()
INTERNAL: (Override from BasicAccessor) Method to check if m_node represents a primary key.

        if (m_node.getLocalName().equals(XMLConstants.ID)) {
            return true;
        } else {
            return super.isId();   
        }
    
public booleanisOptional()
INTERNAL: (Override from BasicAccessor)

        return m_helper.isOptional(m_node);
    
public booleanisVersion()
INTERNAL: (Override from BasicAccessor) Return true if this accessor represents an optimistic locking field.

        if (m_node.getLocalName().equals(XMLConstants.VERSION)) {
            return true;
        } else {
            return super.isVersion();   
        }
    
protected voidprocessGeneratedValue(oracle.toplink.essentials.internal.helper.DatabaseField field)
INTERNAL: (Override from BasicAccessor)

        Node node = m_helper.getNode(m_node, XMLConstants.GENERATED_VALUE);

        if (node == null) {
            super.processGeneratedValue(field);
        } else {
            // Ask the common processor to process what we found.
            processGeneratedValue(new XMLGeneratedValue(node, m_helper), field);
        }
    
protected voidprocessSequenceGenerator()
INTERNAL: (Override from NonRelationshipAccessor) Process this accessor's sequence-generator node into a common metadata sequence generator.

        Node node = m_helper.getNode(m_node, XMLConstants.SEQUENCE_GENERATOR);
        
        if (node != null) {
            // Process the xml defined sequence generators first.
            processSequenceGenerator(new XMLSequenceGenerator(node, m_helper));
        }
        
        // Process the annotation defined sequence generators second.
        super.processSequenceGenerator();
    
protected voidprocessTableGenerator()
INTERNAL: (Override from NonRelationshipAccessor) Process this accessor's table-generator node into a common metadata table generator.

        Node node = m_helper.getNode(m_node, XMLConstants.TABLE_GENERATOR);
        
        if (node != null) {
            // Process the xml defined table generators first.
            processTableGenerator(new XMLTableGenerator(node, this));
        }
        
        // Process the annotation defined sequence generators second.
        super.processTableGenerator();