FileDocCategorySizeDatePackage
XMLTableGenerator.javaAPI DocGlassfish v2 API6050Tue May 22 16:54:32 BST 2007oracle.toplink.essentials.internal.ejb.cmp3.xml.sequencing

XMLTableGenerator

public class XMLTableGenerator extends MetadataTableGenerator
Object to hold onto an xml table generator metadata.
author
Guy Pelletier
since
TopLink EJB 3.0 Reference Implementation

Fields Summary
protected Node
m_node
protected XMLAccessor
m_accessor
Constructors Summary
public XMLTableGenerator(Node node, XMLAccessor accessor)
INTERNAL:

        super(accessor.getDocumentName());
        
        m_node = node;
        m_accessor = accessor;
    
Methods Summary
public intgetAllocationSize()
INTERNAL:

        return m_accessor.getHelper().getNodeValue(m_node, XMLConstants.ATT_ALLOCATION_SIZE, 50);
    
public java.lang.StringgetCatalog()
INTERNAL:

        return m_accessor.getHelper().getNodeValue(m_node, XMLConstants.ATT_CATALOG, m_accessor.getCatalog());
    
public intgetInitialValue()
INTERNAL:

        return m_accessor.getHelper().getNodeValue(m_node, XMLConstants.ATT_INITIAL_VALUE, 0);
    
public java.lang.StringgetName()
INTERNAL:

        return m_accessor.getHelper().getNodeValue(m_node, XMLConstants.ATT_NAME);
    
public java.lang.StringgetPkColumnName()
INTERNAL:

        return m_accessor.getHelper().getNodeValue(m_node, XMLConstants.ATT_PK_COLUMN_NAME);
    
public java.lang.StringgetPkColumnValue()
INTERNAL:

        return m_accessor.getHelper().getNodeValue(m_node, XMLConstants.ATT_PK_COLUMN_VALUE);
    
public java.lang.StringgetSchema()
INTERNAL:

        return m_accessor.getHelper().getNodeValue(m_node, XMLConstants.ATT_SCHEMA, m_accessor.getSchema());
    
public java.lang.StringgetTable()
INTERNAL:

        return m_accessor.getHelper().getNodeValue(m_node, XMLConstants.ATT_TABLE);
    
public java.util.ListgetUniqueConstraints()
INTERNAL:

        if (m_uniqueConstraints == null) {
            m_uniqueConstraints = new ArrayList<String[]>();
            NodeList uniqueConstraintNodes = m_accessor.getHelper().getNodes(m_node, XMLConstants.UNIQUE_CONSTRAINTS);
        
            if (uniqueConstraintNodes != null) {
                for (int i = 0; i < uniqueConstraintNodes.getLength(); i++) {
                    NodeList columnNameNodes = m_accessor.getHelper().getTextColumnNodes(uniqueConstraintNodes.item(i));
                
                    if (columnNameNodes != null) {
                        List<String> columnNames = new ArrayList<String>(columnNameNodes.getLength());
                        for (int k = 0; k < columnNameNodes.getLength(); k++) {
                            String columnName = columnNameNodes.item(k).getNodeValue();
                        
                            if (columnName != null && !columnName.equals("")) {
                                columnNames.add(columnName);
                            }
                        }
                        if (columnNames.size() > 0) {
                            m_uniqueConstraints.add(columnNames.toArray(new String[0]));
                        }
                    }
                }
            }
        }
        
        return m_uniqueConstraints;
    
public java.lang.StringgetValueColumnName()
INTERNAL:

        return m_accessor.getHelper().getNodeValue(m_node, XMLConstants.ATT_VALUE_COLUMN_NAME);
    
public booleanloadedFromAnnotations()
INTERNAL:

       return false; 
    
public booleanloadedFromXML()
INTERNAL:

       return true;