This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
magik-demo:developer:class:core:query [2013/07/19 10:39] alex [parseTermName] |
magik-demo:developer:class:core:query [2017/07/06 15:24] (current) |
||
|---|---|---|---|
| Line 6: | Line 6: | ||
| This class describes a query that can be logically seen as a conjunction of relations (with equalities between attributes but without comparisons) | This class describes a query that can be logically seen as a conjunction of relations (with equalities between attributes but without comparisons) | ||
| + | {{ :magik-demo:developer:class:core:query.png?nolink&600 |}} | ||
| ===== Class Attributes ===== | ===== Class Attributes ===== | ||
| Line 16: | Line 17: | ||
| private java.lang.String sql | private java.lang.String sql | ||
| private boolean sematincs | private boolean sematincs | ||
| + | private java.util.LinkedHashMap relationsMap | ||
| + | private boolean countExists | ||
| </code> | </code> | ||
| - | ===== Class Constructor ===== | + | ===== Class Constructors ===== |
| - | ==== Atom ==== | + | ==== Query ==== |
| <code java> | <code java> | ||
| public Query () | public Query () | ||
| Line 32: | Line 35: | ||
| ---- | ---- | ||
| - | + | ==== Query ==== | |
| - | ==== Atom ==== | + | |
| <code java> | <code java> | ||
| public Query (java.lang.String name, | public Query (java.lang.String name, | ||
| Line 46: | Line 48: | ||
| * it.unibz.inf.magik.core.QueryMinimizer | * it.unibz.inf.magik.core.QueryMinimizer | ||
| * it.unibz.inf.magik.core.PreProcessor | * it.unibz.inf.magik.core.PreProcessor | ||
| - | * it.unibz.inf.magik.test.TestFK | ||
| * it.unibz.inf.magik.test.TestFK | * it.unibz.inf.magik.test.TestFK | ||
| * it.unibz.inf.magik.test.TestFK2 | * it.unibz.inf.magik.test.TestFK2 | ||
| Line 71: | Line 72: | ||
| ---- | ---- | ||
| - | ==== Atom ==== | + | ==== Query ==== |
| <code java> | <code java> | ||
| public Query (java.lang.String name, | public Query (java.lang.String name, | ||
| Line 95: | Line 96: | ||
| * ParseSQLQueryException | * ParseSQLQueryException | ||
| * ContextException | * ContextException | ||
| - | |||
| ===== Class Methods ===== | ===== Class Methods ===== | ||
| Line 452: | Line 452: | ||
| ---- | ---- | ||
| + | |||
| + | ==== printHTML ==== | ||
| + | |||
| + | <code java> | ||
| + | public java.lang.String printHTML() | ||
| + | </code> | ||
| + | |||
| + | Print the query in a most compact way | ||
| + | |||
| + | **Returns:** | ||
| + | * String query in this format ''table(attr1, attr2)'' | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== printSQLHTML ==== | ||
| + | |||
| + | <code java> | ||
| + | public java.lang.String printSQLHTML(boolean isVirtualSchema) | ||
| + | </code> | ||
| + | |||
| + | Print the query in a most compact way | ||
| + | |||
| + | **Parameters:** | ||
| + | * isVirtualSchema - //true// if the schema is virtual, //false// otherwise | ||
| + | **Returns:** | ||
| + | * String query in SQL format | ||
| + | |||
| + | |||
| + | ---- | ||
| + | ==== replaceTerm ==== | ||
| + | |||
| + | <code java> | ||
| + | public void replaceTerm (java.lang.String termOld, | ||
| + | java.lang.String termNew) | ||
| + | throws ParseSQLQueryException | ||
| + | </code> | ||
| + | |||
| + | Apply condition to list of atoms and also terms (output variables) | ||
| + | |||
| + | **Parameters:** | ||
| + | * termOld - string of term to be replaced | ||
| + | * termNew - string of term to replace with | ||
| + | **Throws:** | ||
| + | * ParseSQLQueryException | ||
| + | |||
| + | |||
| + | ---- | ||
| + | ==== getters and setters methods ==== | ||
| + | |||
| + | <code java> | ||
| + | public boolean getSemantics() | ||
| + | public void setSemantics(boolean semantics) | ||
| + | |||
| + | public java.lang.String getName() { | ||
| + | public void setName(java.lang.String name) | ||
| + | |||
| + | public java.util.ArrayList<Atom> getAtoms() | ||
| + | public void setAtoms(java.util.ArrayList<Atom> atoms) | ||
| + | |||
| + | public java.lang.String getDescription() | ||
| + | public void setDescription(java.lang.String description) | ||
| + | |||
| + | public java.util.ArrayList<Term> getOutputVariables() | ||
| + | public void setOutputVariables(java.util.ArrayList<Term> outputVariables) | ||
| + | |||
| + | public java.lang.String getSql() | ||
| + | public void setSql(java.lang.String sql) | ||
| + | |||
| + | public long getId() | ||
| + | public void setId(long id) | ||
| + | </code> | ||
| + | |||
| + | [[magik-demo:developer:class:core:query|Back to Top]] | [[magik-demo:start|Back to Home Page]] | ||