SMACS

smacs.write.tree
Class ProgramInsertRecordField

java.lang.Object
  extended byorg.dom4j.tree.AbstractNode
      extended byorg.dom4j.tree.AbstractBranch
          extended byorg.dom4j.tree.AbstractElement
              extended byorg.dom4j.tree.DefaultElement
                  extended bysmacs.tree.ScriptNode
                      extended bysmacs.write.tree.ProgramScriptNode
                          extended bysmacs.write.tree.ProgramInsertRecordField
All Implemented Interfaces:
Branch, Cloneable, CreateListener, Element, EventListener, FixNode, FixNodeListener, GetName, GetSimpleNode, HasNodeHandler, HasNodeReferenceAttribute, smacs.tree.HasNodeReferenceId, HasRecordBaseNameSpec, HasRecordFieldName, HasRecordName, HasSqlOfExpression, IsaNodeReferenceChildListener, IsaNodeReferenceListener, NewSimpleNode, Node, Node, ProgramInsertRecordFieldElement, ProgramSimpleNode, Serializable, SimpleElement, SimpleNode, SimpleNodeChild, SmacsFixNode

public class ProgramInsertRecordField
extends ProgramScriptNode
implements ProgramInsertRecordFieldElement

conversion into insert record field layout +.

While the source cursor can be assumed to be the result of a compact "query" we have a difference for the target insert record: each of its field might be remapped, converted or may be dependent on another record. That "other" record is generally the current loop record but in our model it might also be another insert record being around.

And such things must be computed, of course. For our conviences, the following "RecordField" knows a special variant of being "*" all fields from a cursor, and each part might be unknown at computation time which does limit the way we can handle its content right here.

Author:
Copyright (C) 2004, Guido Draheim. All rights reserved. Part of SMACS project.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class smacs.tree.ScriptNode
_NodeHandler, log, TokenValue
 
Fields inherited from class org.dom4j.tree.AbstractElement
EMPTY_ITERATOR, EMPTY_LIST, USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRING
 
Fields inherited from class org.dom4j.tree.AbstractBranch
DEFAULT_CONTENT_LIST_SIZE, outputFormat
 
Fields inherited from class org.dom4j.tree.AbstractNode
NODE_TYPE_NAMES
 
Fields inherited from interface smacs.tree.SimpleNode
TokenValue
 
Fields inherited from interface org.dom4j.Node
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE
 
Constructor Summary
ProgramInsertRecordField(DbMappingRecordField field)
           
 
Method Summary
 void addDbMappingRecordField(DbMappingRecordField field)
           
protected  HasProgramCurrentRecordVariable findParentHasProgramCurrentRecordVariable()
          helper call
 void freezeInsertRecordSet()
          build specific variants of the record field.
 ProgramSqlFieldExpression getProgramSqlFieldExpression()
           
 String getRecordBaseNameSpec()
          any syntactic qualifier of the table schema name.
 String getRecordFieldName()
          return the name of the RecordField.
 String getRecordName()
          the table name.
 SimpleNode getSqlOfExpression()
           
 DbMappingRecordField hasDbMappingRecordField()
           
 void initProgramSqlFieldExpression()
           
 PsqlAddFromCursorRecord newPsqlAddFromCursorRecord(HasCurrentRecordPsqlVariable cursor)
           
 void pushJavaScript(JavaScriptNode script)
          generate java script nodes.
 void pushJavaScript(JavaScriptNode script, HasCurrentRecordJavaVariable cursor)
          used in ProgramInsertValuesRecord as adds({#link newPsqlAddFromCursorRecord})
 void pushPsqlScript(PsqlScriptNode script)
          generate psql script nodes.
 void pushPsqlScript(PsqlScriptNode script, HasCurrentRecordPsqlVariable cursor)
          used in ProgramInsertValuesRecord as adds({#link newPsqlAddFromCursorRecord})
 
Methods inherited from class smacs.write.tree.ProgramScriptNode
_freezeAssembleInsertTargetNames, _freezeDistinctSet, _freezeInsertCondition, _freezeInsertRecordSet, _freezeMaterializeInsertTargetRecords, _freezeMaterializeQuery, _freezeResolveWithInsertTargetNames, _pushJavaScript, _pushPsqlScript, adds, freezeAssembleInsertTargetNames, freezeDistinctSet, freezeInsertCondition, freezeMaterializeInsertTargetRecords, freezeMaterializeQuery, freezeResolveWithInsertTargetNames, freezeScript, newNode, newNode, newNode
 
Methods inherited from class smacs.tree.ScriptNode
_fixNodeTree, _getTokenValue, _getValueTokenValue, _hasTokenValue, _init, add, add, addAll, addAll, addChild, addChild, addNewNode, addNodeReference, addNodeReference, addNodeReference, addNodeReference, appendAttributes, appendText, clear, cloneFrom, contains, containsAll, countTokenName, dump, fireNodeReferenceChildHasChanged, fireNodeReferenceHasChanged, firstTokenName, firstTokenName, fixNode, fixNodeTree, get, getAttributeValue, getHandler, getId, getMember, getMember, getMember, getMember, getMemberChild, getMemberChild, getMemberChild, getMemberList, getMemberListChild, getMemberOption, getMemberOption, getMemberOption, getMemberValue, getMemberValue, getMemberValue, getNodeNameFromClassName, getNodeReferenceCount, getNodeReferenceCount, getNodeReferenceId, getNodeReferenceId, getOption, getOption, getOption, getParentNode, getParentNode, getParentNode, getParentNode, getSimpleNode, getSingleTextChild, getThisParentNode, getThisParentNode, getTokenName, getTokenValue, hasChildren, hasMember, hasMember, hasNodeHandler, hasNodeReference, hasNodeReferenceChildNodes, hasNodeReferenceChildNodes, hasNodeReferenceId, hasNodeReferenceId, hasSingleTextChild, hasTokenName, hasTokenValue, indexOf, isEmpty, iterator, jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, lastIndexOf, lastTokenName, lastTokenName, listIterator, listIterator, memberElement, newChildren, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNodeLike, newNodeReferenceAttribute, newNodeReferenceAttribute, newNodeReferenceId, newNodeReferenceId, onNodeReferenceChildHasChanged, onNodeReferenceHasChanged, printXML, printXML, removeAll, removeAttribute, removeChild, removeChild, removeNodeReference, replace, retainAll, set, setHandler, setMemberChild, setMemberChild, setMemberChild, setMemberList, setMemberListChild, setMemberOption, setMemberOption, setMemberOption, setMemberValue, setMemberValue, setMemberValue, setNodeReference, setNodeReference, setNodeReference, setOption, setOption, setOption, setOption, setTokenName, setTokenValue, size, strSingleTextChild, subList, toArray, toArray, toString, toString, toXML, toXML
 
Methods inherited from class org.dom4j.tree.DefaultElement
add, additionalNamespaces, additionalNamespaces, addNewNode, attribute, attribute, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, attributes, clearContent, clone, contentList, declaredNamespaces, element, element, element, elementIterator, elementIterator, elementIterator, elementIterator, elements, elements, elements, elements, getDocument, getDocumentFactory, getNamespaceForPrefix, getNamespaceForURI, getParent, getQName, getStringValue, getText, indexOf, node, nodeCount, nodeIterator, processingInstruction, processingInstructions, processingInstructions, remove, removeNode, removeProcessingInstruction, setAttributeList, setAttributes, setContent, setDocument, setParent, setQName, supportsParent
 
Methods inherited from class org.dom4j.tree.AbstractElement
accept, add, add, add, add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addElement, addEntity, addNamespace, addNode, addProcessingInstruction, addProcessingInstruction, addText, asXML, attributeValue, attributeValue, attributeValue, attributeValue, childAdded, childRemoved, createAttributeList, createAttributeList, createCopy, createCopy, createCopy, createElement, createElement, createSingleIterator, elementText, elementText, elementTextTrim, elementTextTrim, ensureAttributesCapacity, getData, getName, getNamespace, getNamespacePrefix, getNamespaceURI, getNodeType, getPath, getQName, getQualifiedName, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setData, setName, setNamespace, setText, write
 
Methods inherited from class org.dom4j.tree.AbstractBranch
addElement, addElement, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getTextTrim, hasContent, invalidNodeTypeAddException, isReadOnly, setProcessingInstructions
 
Methods inherited from class org.dom4j.tree.AbstractNode
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface smacs.tree.SimpleNode
add, add, addAll, addAll, addChild, addChild, addNewNode, addNodeReference, addNodeReference, addNodeReference, addNodeReference, appendAttributes, appendText, clear, cloneFrom, contains, containsAll, countTokenName, dump, fireNodeReferenceChildHasChanged, fireNodeReferenceHasChanged, firstTokenName, firstTokenName, fixNode, fixNodeTree, get, getAttributeValue, getHandler, getId, getMember, getMember, getMember, getMember, getMemberChild, getMemberChild, getMemberChild, getMemberList, getMemberListChild, getMemberOption, getMemberOption, getMemberOption, getMemberValue, getMemberValue, getMemberValue, getNodeReferenceCount, getNodeReferenceCount, getNodeReferenceId, getNodeReferenceId, getOption, getOption, getOption, getParentNode, getParentNode, getParentNode, getParentNode, getSimpleNode, getSingleTextChild, getThisParentNode, getThisParentNode, getTokenName, getTokenValue, hasChildren, hasMember, hasMember, hasNodeHandler, hasNodeReference, hasNodeReferenceChildNodes, hasNodeReferenceChildNodes, hasNodeReferenceId, hasNodeReferenceId, hasSingleTextChild, hasTokenName, hasTokenValue, indexOf, isEmpty, iterator, jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, lastIndexOf, lastTokenName, lastTokenName, listIterator, listIterator, memberElement, newChildren, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNodeReferenceAttribute, onNodeReferenceChildHasChanged, onNodeReferenceHasChanged, printXML, printXML, removeAll, removeAttribute, removeChild, removeChild, removeNodeReference, replace, retainAll, set, setHandler, setMemberChild, setMemberChild, setMemberChild, setMemberList, setMemberListChild, setMemberOption, setMemberOption, setMemberOption, setMemberValue, setMemberValue, setMemberValue, setNodeReference, setNodeReference, setNodeReference, setOption, setOption, setOption, setOption, setTokenName, setTokenValue, size, strSingleTextChild, subList, toArray, toArray, toString, toString, toXML, toXML
 
Methods inherited from interface org.dom4j.Element
add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addEntity, additionalNamespaces, addNamespace, addProcessingInstruction, addProcessingInstruction, addText, attribute, attribute, attribute, attributeCount, attributeIterator, attributes, attributeValue, attributeValue, attributeValue, attributeValue, createCopy, createCopy, createCopy, declaredNamespaces, element, element, elementIterator, elementIterator, elementIterator, elements, elements, elements, elementText, elementText, elementTextTrim, elementTextTrim, getData, getNamespace, getNamespaceForPrefix, getNamespaceForURI, getNamespacePrefix, getNamespaceURI, getQName, getQName, getQualifiedName, getStringValue, getText, getTextTrim, getXPathResult, hasMixedContent, isRootElement, isTextOnly, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setData, setQName
 
Methods inherited from interface org.dom4j.Branch
add, add, add, add, addElement, addElement, addElement, appendContent, clearContent, content, elementByID, indexOf, node, nodeCount, nodeIterator, normalize, processingInstruction, processingInstructions, processingInstructions, remove, remove, remove, remove, removeProcessingInstruction, setContent, setProcessingInstructions
 
Methods inherited from interface org.dom4j.Node
accept, asXML, asXPathResult, clone, createXPath, detach, getDocument, getName, getNodeType, getNodeTypeName, getParent, getPath, getPath, getUniquePath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, setText, supportsParent, valueOf, write
 
Methods inherited from interface smacs.util.listen.GetName
getName
 

Constructor Detail

ProgramInsertRecordField

public ProgramInsertRecordField(DbMappingRecordField field)
Method Detail

addDbMappingRecordField

public void addDbMappingRecordField(DbMappingRecordField field)

hasDbMappingRecordField

public DbMappingRecordField hasDbMappingRecordField()

pushPsqlScript

public void pushPsqlScript(PsqlScriptNode script)
Description copied from class: ProgramScriptNode
generate psql script nodes.

Specified by:
pushPsqlScript in interface ProgramSimpleNode
Overrides:
pushPsqlScript in class ProgramScriptNode

pushPsqlScript

public void pushPsqlScript(PsqlScriptNode script,
                           HasCurrentRecordPsqlVariable cursor)
used in ProgramInsertValuesRecord as adds({#link newPsqlAddFromCursorRecord})


freezeInsertRecordSet

public void freezeInsertRecordSet()
build specific variants of the record field. a generalization of the script specific nodes.

Specified by:
freezeInsertRecordSet in interface ProgramSimpleNode
Overrides:
freezeInsertRecordSet in class ProgramScriptNode

newPsqlAddFromCursorRecord

public PsqlAddFromCursorRecord newPsqlAddFromCursorRecord(HasCurrentRecordPsqlVariable cursor)

pushJavaScript

public void pushJavaScript(JavaScriptNode script)
Description copied from class: ProgramScriptNode
generate java script nodes.

Specified by:
pushJavaScript in interface ProgramSimpleNode
Overrides:
pushJavaScript in class ProgramScriptNode

pushJavaScript

public void pushJavaScript(JavaScriptNode script,
                           HasCurrentRecordJavaVariable cursor)
used in ProgramInsertValuesRecord as adds({#link newPsqlAddFromCursorRecord})


getRecordFieldName

public String getRecordFieldName()
Description copied from interface: HasRecordFieldName
return the name of the RecordField.

Specified by:
getRecordFieldName in interface HasRecordFieldName

getRecordName

public String getRecordName()
Description copied from interface: HasRecordName
the table name.

Specified by:
getRecordName in interface HasRecordName

getRecordBaseNameSpec

public String getRecordBaseNameSpec()
Description copied from interface: HasRecordBaseNameSpec
any syntactic qualifier of the table schema name.

Specified by:
getRecordBaseNameSpec in interface HasRecordBaseNameSpec

getSqlOfExpression

public SimpleNode getSqlOfExpression()
Specified by:
getSqlOfExpression in interface HasSqlOfExpression

getProgramSqlFieldExpression

public ProgramSqlFieldExpression getProgramSqlFieldExpression()
Specified by:
getProgramSqlFieldExpression in interface ProgramInsertRecordFieldElement

initProgramSqlFieldExpression

public void initProgramSqlFieldExpression()

findParentHasProgramCurrentRecordVariable

protected HasProgramCurrentRecordVariable findParentHasProgramCurrentRecordVariable()
helper call


SMACS