Java Doc for SQLPredicate.java in  » Rule-Engine » Mandarax » org » mandarax » sql » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Rule Engine » Mandarax » org.mandarax.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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




Constructor Summary
public  SQLPredicate()
     Constructor.
public  SQLPredicate(String n, String q, DataSource ds)
     Constructor.
public  SQLPredicate(String n, String q, SQLConnectionManager conMan)
     Constructor with a given connection manager.

Method Summary
public  booleanequals(Object obj)
     Compare objects.
public  voidfetchStructure()
     Get the structure of the predicate, i.e.
public  DataSourcegetDataSource()
     Set the data source.
public  StringgetName()
     Get the name of the predicate.
public  StringgetQuery()
     Get the query string.
public  String[]getSlotNames()
     Get the slot names.
public  java.lang.Class[]getStructure()
     Get the type structure of the object, e.g.
public  SQLTypeMappinggetTypeMapping()
     Get the new type mapping.
public  inthashCode()
     Get the hashcode of the object.
public  booleanisExecutable()
     Indicates whether the object (usually a term or a clause set) can be performed using the java semantics.
public  Objectperform(org.mandarax.kernel.Term[] parameter, Session session)
     Perform the predicate using an array of terms as parameters. If the terms can be resolved, we iterate over the result set and look for matching records. If such a record is found, Boolean.TRUE is returned.
public  voidsetDataSource(DataSource ds)
     Set the data source.
public  voidsetName(String n)
     Set the name.
public  voidsetQuery(String q)
     Set the query.
public  voidsetSlotNames(String[] names)
     Set the slot names.
public  voidsetStructure(Class[] struct)
     Set the structure of the predicates, i.e.
public  voidsetTypeMapping(SQLTypeMapping map)
     Set the type mapping used.
public  booleanslotNamesCanBeEdited()
     Indicates whether the slot names can be modified.
public  StringtoString()
     Convert the object to a string.


Constructor Detail
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.




Method Detail
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



getTypeMapping
public SQLTypeMapping getTypeMapping()(Code)
Get the new type mapping. a type mapping



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



perform
public Object perform(org.mandarax.kernel.Term[] parameter, Session session) throws UnsupportedOperationException, IllegalArgumentException(Code)
Perform the predicate using an array of terms as parameters. If the terms can be resolved, we iterate over the result set and look for matching records. If such a record is found, Boolean.TRUE is returned. Boolean.FALSE is returned otherwise. Note that this operation can be slow! @todo: Figure out performance improvments by adding a WHERE clause. the result of the perform operation
Parameters:
  parameter - an array of terms
Parameters:
  session - a session object
throws:
  java.lang.UnsupportedOperationException - thrown if this constructor does not have a sematics and this operation cannot be supported
throws:
  java.lang.IllegalArgumentException -



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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.