|
SMACS | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dom4j.tree.AbstractNode
org.dom4j.tree.AbstractBranch
org.dom4j.tree.AbstractElement
org.dom4j.tree.DefaultElement
smacs.tree.ScriptNode
smacs.write.script.PsqlScriptNode
smacs.write.script.PsqlScriptInvisibleNode
smacs.write.script.PsqlFieldResolver
field resolver for sql expression copies.
While writing the PlSql script we might create a cursor that contains some "fields" on return of the select clause. These fields shall be resolved in any of the sql expressions about to be copied directly into the output script - essentially we have to subsitute a "fieldname" by "cursorrecord.fieldname" and we have to ensure that during DynamicSQL we interrupt the string mode.
A necessary prerequisite is simply having a list of mappings of fieldnames into a target clause. We'll also push a set of helper functions into this class that are used anywhere there will be a mapping to be performed.
| Nested Class Summary | |
static class |
PsqlFieldResolver.ViaCursor
resolve via cursor. a helper that defines a custom PsqlFieldResolver.ViaCursor.print(PsqlPrintStream) method. |
| Field Summary | |
static boolean |
quote_ident
|
| 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 | |
PsqlFieldResolver()
constructor. |
|
PsqlFieldResolver(PsqlRecordVariable var)
constructor. add mapping list of given record layout |
|
PsqlFieldResolver(String name)
Deprecated. do not override default node name. use constructor without name argument. |
|
PsqlFieldResolver(String name,
PsqlRecordVariable var)
Deprecated. do not override default node name. use constructor without name argument. |
|
| Method Summary | |
void |
addAllFromCursorRecord(PsqlRecordVariable var)
add mapping list from record layout. |
void |
addFieldFromCursorRecord(String field,
PsqlRecordVariable var)
add mapping for record prefix. |
void |
replaceSqlNodes(SimpleNode tree)
prepare sql snippet for output. |
void |
replaceSqlTableReferenceNodes(SimpleNode tree)
resolve TableReferences in sql snippets. |
| Methods inherited from class smacs.write.script.PsqlScriptInvisibleNode |
print |
| Methods inherited from class smacs.write.script.PsqlScriptNode |
adds, freeze, freezePsqlChildren, newNode, newNode, print, printPsqlChildren, printPsqlChildrenBlock, printPsqlChildrenBlock, printstring, resolve, resolvePsqlChildren |
| 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 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 |
| Field Detail |
public static boolean quote_ident
| Constructor Detail |
public PsqlFieldResolver()
public PsqlFieldResolver(String name)
public PsqlFieldResolver(PsqlRecordVariable var)
public PsqlFieldResolver(String name,
PsqlRecordVariable var)
| Method Detail |
public void addAllFromCursorRecord(PsqlRecordVariable var)
public void addFieldFromCursorRecord(String field,
PsqlRecordVariable var)
public void replaceSqlNodes(SimpleNode tree)
replaceSqlTableReferenceNodes(smacs.tree.SimpleNode)public void replaceSqlTableReferenceNodes(SimpleNode tree)
PsqlScriptInvisibleNode.print(PsqlPrintStream)
PsqlFieldResolver.ViaCursor
|
SMACS | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||