|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.mdm.index.query.QueryParser
com.sun.mdm.index.query.SingleQueryParser
This Parser parses a QueryObject and produces a single SQL statement. The SQL statement would contain all the objects queried in QueryObject. Say if we have an object graph like: System Person Address Phone Alias This would produce SQL statement: select system.attributes, person.attributes, address.attributes, phone.attribute, alias.attributes from System, person, address, phone, alias where system.euid = person.euid and person.personid = address.personid and person.personid = phone.personid and person.personid = alias.personid The SQL statement created by it would produce lots of redundant data as it would use cartesian product among secondary objects. So this is more useful where the applications want tuples.
Constructor Summary | |
(package private) |
SingleQueryParser(QueryObject qo)
Creates a new instance of SingleQueryParser |
Method Summary | |
(package private) void |
checkForInvalidObjects(java.util.HashSet objects,
QPath[] qpaths)
|
(package private) ConditionMap[] |
createConditionMap(java.util.HashSet objects,
QPath[] qpaths,
Condition[] conditions)
|
(package private) QPath[] |
createQPath(java.lang.String root,
java.util.HashSet objectsHS)
This is the actual method that creates the QPath[] each of which is a path from root to a different leaf. |
(package private) java.util.HashSet |
findObjects(QualifiedField[] selectFields)
|
(package private) java.util.HashSet |
findObjects(QualifiedField[] selectFields,
Condition[] conditions)
|
(package private) QueryObject |
getQueryObject()
|
(package private) java.lang.String |
getRoot()
|
(package private) java.lang.String |
getRoot(QualifiedField[] selectFields,
Condition[] conditions)
|
(package private) java.lang.String[] |
getRootId()
Returns full qualified path for root object primary key |
static void |
main(java.lang.String[] args)
Test code |
SQLDescWithBindParameters[] |
parse()
parses the QueryObject. |
(package private) QualifiedField[] |
qualify(java.lang.String[] selectFields)
|
(package private) void |
setQueryObject(QueryObject qo)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
SingleQueryParser(QueryObject qo)
qo
- QueryObjectMethod Detail |
void checkForInvalidObjects(java.util.HashSet objects, QPath[] qpaths) throws QMException
QMException
ConditionMap[] createConditionMap(java.util.HashSet objects, QPath[] qpaths, Condition[] conditions)
QPath[] createQPath(java.lang.String root, java.util.HashSet objectsHS)
root
- root of the tree that contains objectsobjectsHS
- HashSet contains the objects.java.util.HashSet findObjects(QualifiedField[] selectFields)
java.util.HashSet findObjects(QualifiedField[] selectFields, Condition[] conditions)
QueryObject getQueryObject()
java.lang.String getRoot()
java.lang.String getRoot(QualifiedField[] selectFields, Condition[] conditions)
java.lang.String[] getRootId() throws QMException
QMException
public static void main(java.lang.String[] args)
args
- argspublic SQLDescWithBindParameters[] parse() throws QMException
parse
in class QueryParser
QMException
- QMExceptionQualifiedField[] qualify(java.lang.String[] selectFields) throws QMException
QMException
void setQueryObject(QueryObject qo)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Sun Microsystems, Inc.