| java.lang.Object org.mandarax.sql.SQLPredicate
SQLPredicate | public class SQLPredicate implements Predicate,LogCategories(Code) | | Implementation of a predicate based on a SQL query.
The query defines the structure of the predicate, SQL types are mapped via
a DBMapping object to java types. The query does not have a WHERE clause,
since the where clause would only define the extension (= the rows in the result set),
not the structure itself. The where clause comes in when clause sets are defined
on top of the predicate.
As from version 1.7.1, SQLPredicates can be performed (@see org.mandarax.kernel.SemanticsSupport).
See Also: java.sql.ResultSet See Also: org.mandarax.sql.SQLTypeMapping author: Jens Dietrich version: 3.4 <7 March 05> since: 1.5 |
SQLPredicate | public SQLPredicate()(Code) | | Constructor.
|
SQLPredicate | public SQLPredicate(String n, String q, DataSource ds)(Code) | | Constructor.
Parameters: n - a name Parameters: q - a query Parameters: ds - a data source |
SQLPredicate | public SQLPredicate(String n, String q, SQLConnectionManager conMan)(Code) | | Constructor with a given connection manager.
Parameters: n - a name Parameters: q - a query Parameters: conMan - the given connection manager. |
equals | public boolean equals(Object obj)(Code) | | Compare objects.
Parameters: obj - another object a boolean |
fetchStructure | public void fetchStructure() throws SQLException(Code) | | Get the structure of the predicate, i.e. the types associated with the columns
in the result set of the query. We obtain the information by issuing a query,
therefore the database must be 'live'.
|
getDataSource | public DataSource getDataSource()(Code) | | Set the data source.
a data source. |
getName | public String getName()(Code) | | Get the name of the predicate.
the name of the predicate |
getQuery | public String getQuery()(Code) | | Get the query string.
a query |
getSlotNames | public String[] getSlotNames()(Code) | | Get the slot names.
an array of strings, the length of the array is the same asthe length of the array of terms (the structure of the predicate) |
getStructure | public java.lang.Class[] getStructure()(Code) | | Get the type structure of the object, e.g. the types of terms
that can be used with this constructor.
an array of classes |
hashCode | public int hashCode()(Code) | | Get the hashcode of the object.
the hash code of the object |
isExecutable | public boolean isExecutable()(Code) | | Indicates whether the object (usually a term or a clause set) can be performed
using the java semantics.
false |
setDataSource | public void setDataSource(DataSource ds)(Code) | | Set the data source.
Parameters: ds - a data source. |
setName | public void setName(String n)(Code) | | Set the name.
Parameters: n - a name |
setQuery | public void setQuery(String q)(Code) | | Set the query.
Parameters: q - a query string (a SELECT statement without an WHERE clause |
setSlotNames | public void setSlotNames(String[] names)(Code) | | Set the slot names.
Parameters: names - an array of strings, the length of the array is the same asthe length of the array of terms (the structure of the predicate) |
setStructure | public void setStructure(Class[] struct)(Code) | | Set the structure of the predicates, i.e. the types of the terms.
Should be handled with care since it must be consistent with the type mapping
used and the (SQL) type and number of columns in the result set.
Parameters: an - array of classes |
setTypeMapping | public void setTypeMapping(SQLTypeMapping map)(Code) | | Set the type mapping used.
Parameters: map - a type mapping |
slotNamesCanBeEdited | public boolean slotNamesCanBeEdited()(Code) | | Indicates whether the slot names can be modified.
a boolean |
toString | public String toString()(Code) | | Convert the object to a string.
a string |
|
|