Java Doc for Result.java in  » Web-Framework » jWebApp » jpersist » 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 » Web Framework » jWebApp » jpersist 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jpersist.Result

Result
public class Result implements ResultObject<T>(Code)
The result class is created and returned by all query methods in jpersist.Database and jpersist.DatabaseManager, and basically wraps a ResultSet with ResultSet functionality, along with ListIterator and object loading functionality.



Constructor Summary
public  Result(Database db, ResultSet resultSet)
     Create an instance of Result by passing in a jpersist.Database instance and a ResultSet instance returned from a query (statement.getResultSet()).
public  Result(Database db, ResultSet resultSet, Class<T> cs)
     Create an instance of Result by passing in a jpersist.Database instance and a ResultSet instance returned from a query (statement.getResultSet()).

Method Summary
public  voidadd(Object o)
     See same in java.sql.ListIterator.
public  voidafterLast()
    
public  voidbeforeFirst()
    
public  ObjectcastToInterface(Class interfaceClass, Object... handlers)
     Casts the result to an interface.
public  voidclose()
     Closes all resources associated with a JDBC Statement and ResultSet.
public  voiddeleteRow()
    
public  booleanfirst()
    
public  StringgetClose()
     Closes the result (simply calls close()), can be used in EL.
public  CgetColumnValue(String columnName)
     Returns the object defined by named column from the current row in the result set.
public  CgetColumnValue(Class<C> returnType, String columnName)
     Returns the object (after converting it to returnType) defined by named column from the current row in the result set.
public  CgetColumnValue(int columnIndex)
     Returns the object defined by column index from the current row in the result set.
public  CgetColumnValue(Class<C> returnType, int columnIndex)
     Returns the object (after converting it to returnType) defined by named column from the current row in the result set.
public  DatabasegetDatabase()
     Return the current ResultSet, if there is a current ResultSet instance.
public  booleangetMoreResults()
    
public  booleangetMoreResults(int doWhatWithCurrent)
    
public  ResultSetgetResultSet()
     Return the current ResultSet, if there is a current ResultSet instance.
public  StatementgetStatement()
     Returns the current statement or null if no statement is active.
public  booleanhasNext()
    
public  booleanhasPrevious()
    
public  voidinsertRow()
    
public  booleanisAfterLast()
    
public  booleanisBeforeFirst()
    
public  booleanisClosed()
     Returns true if the result is closed, false otherwise.
public  booleanisFirst()
    
public  booleanisLast()
    
public  Iterator<T>iterator()
     If class (see setClass()) is defined, iteration will return instances of class loaded with the current row of data.
public  booleanlast()
    
public  voidloadAssociations(Object object)
     Loads an objects associations.
public  CloadObject(Class<C> cs)
     Load an instance of the class (using set methods that match columns in a table matched to the class name) with the results of the current ResultSet row.
public  CloadObject(Class<C> cs, boolean loadAssociations)
     Load an instance of the class (using set methods that match columns in a table matched to the class name) with the results of the current ResultSet row.
public  CloadObject(C object)
     Load the object (using set methods that match columns in a table matched to the class name) with the results of the current ResultSet row.
public  CloadObject(C object, boolean loadAssociations)
     Load the object (using set methods that match columns in a table matched to the class name) with the results of the current ResultSet row.
public  Collection<C>loadObjects(Collection<C> collection, Class<C> cs)
     Loads objects (using set methods that match columns in a table matched to the class name) into a collection with the results of the current ResultSet.
Parameters:
  collection - an instance of Collection (i.e.
public  Collection<C>loadObjects(Collection<C> collection, Class<C> cs, boolean loadAssociations)
     Loads objects (using set methods that match columns in a table matched to the class name) into a collection with the results of the current ResultSet.
Parameters:
  collection - an instance of Collection (i.e.
public  voidmoveToCurrentRow()
    
public  voidmoveToInsertRow()
    
public  Tnext()
     Returns the next record.
public  Tnext(boolean loadAssociations)
     Returns the next record.
public  Tnext(T object)
     Returns the next record.
public  Tnext(T object, boolean loadAssociations)
     Returns the next record.
public  intnextIndex()
    
public  Tprevious()
     Returns the previous record.
public  Tprevious(boolean loadAssociations)
     Returns the previous record.
public  Tprevious(T object)
     Returns the previous record.
public  Tprevious(T object, boolean loadAssociations)
     Returns the previous record.
public  intpreviousIndex()
    
public  voidrefreshRow()
    
public  voidremove()
    
public  booleanrowDeleted()
    
public  booleanrowInserted()
    
public  booleanrowUpdated()
    
public  voidset(Object o)
     See same in java.sql.ListIterator.
public  ResultsetClass(Class<T> cs)
     Setting the class allows next() and previous() to return loaded (with data from the current row) objects of the class.
public  voidsetClosed(boolean true_only)
     Closes the result (simply calls close()), via a JavaBeans setter.
public  voidsetColumnValue(String columnName, Object object)
     Sets the object value defined by column name in the current row in the result set.
public  voidsetColumnValue(int columnIndex, Object object)
     Sets the object value defined by column index in the current row in the result set.
public  voidsetFetchDirection(int direction)
    
public  voidupdateRow()
    


Constructor Detail
Result
public Result(Database db, ResultSet resultSet) throws JPersistException(Code)
Create an instance of Result by passing in a jpersist.Database instance and a ResultSet instance returned from a query (statement.getResultSet()).
Parameters:
  db -
Parameters:
  resultSet -



Result
public Result(Database db, ResultSet resultSet, Class<T> cs) throws JPersistException(Code)
Create an instance of Result by passing in a jpersist.Database instance and a ResultSet instance returned from a query (statement.getResultSet()).
Parameters:
  db -
Parameters:
  resultSet - Setting the class allows next() and previous() to return loaded (with data from the current row) objects of the class.




Method Detail
add
public void add(Object o)(Code)
See same in java.sql.ListIterator. Not supported, and no need to.
throws:
  UnsupportedOperationException -



afterLast
public void afterLast() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



beforeFirst
public void beforeFirst() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



castToInterface
public Object castToInterface(Class interfaceClass, Object... handlers) throws JPersistException(Code)
Casts the result to an interface. Any get methods in the interface that can be mapped to the current resultSet will automatically return the coresponding value from the current row in the resultSet.

Handlers are objects that provide backing to one or more interface methods. jPersist will check the array of objects for an object that can service a given method and call that method on the object. If no object is found to handle the method it's assumed to be a call to get a column of data from the database.
Parameters:
  interfaceClass - the interface to cast the result to
Parameters:
  handlers - objects that provide backing to one or more interface methods an instance of the interface
throws:
  JPersistException -




close
public void close() throws JPersistException(Code)
Closes all resources associated with a JDBC Statement and ResultSet.



deleteRow
public void deleteRow() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



first
public boolean first() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



getClose
public String getClose() throws JPersistException(Code)
Closes the result (simply calls close()), can be used in EL. For example:
 ${result.close}
 

throws:
  JPersistException -



getColumnValue
public C getColumnValue(String columnName) throws JPersistException(Code)
Returns the object defined by named column from the current row in the result set.
Parameters:
  columnName - the column name the object
throws:
  JPersistException -



getColumnValue
public C getColumnValue(Class<C> returnType, String columnName) throws JPersistException(Code)
Returns the object (after converting it to returnType) defined by named column from the current row in the result set.
Parameters:
  returnType - converts the return type to returnType
Parameters:
  columnName - the column name the object
throws:
  JPersistException -



getColumnValue
public C getColumnValue(int columnIndex) throws JPersistException(Code)
Returns the object defined by column index from the current row in the result set.
Parameters:
  columnIndex - the column index the object
throws:
  JPersistException -



getColumnValue
public C getColumnValue(Class<C> returnType, int columnIndex) throws JPersistException(Code)
Returns the object (after converting it to returnType) defined by named column from the current row in the result set.
Parameters:
  returnType - converts the return type to returnType
Parameters:
  columnIndex - the column index the object
throws:
  JPersistException -



getDatabase
public Database getDatabase() throws JPersistException(Code)
Return the current ResultSet, if there is a current ResultSet instance. a JDBC ResultSet instance or null if there isn't one.
throws:
  JPersistException -



getMoreResults
public boolean getMoreResults() throws JPersistException(Code)
See same in java.sql.Statement
See Also:   java.sql.Statement



getMoreResults
public boolean getMoreResults(int doWhatWithCurrent) throws JPersistException(Code)
See same in java.sql.Statement
See Also:   java.sql.Statement



getResultSet
public ResultSet getResultSet() throws JPersistException(Code)
Return the current ResultSet, if there is a current ResultSet instance. a JDBC ResultSet instance or null if there isn't one.
throws:
  JPersistException -



getStatement
public Statement getStatement() throws JPersistException(Code)
Returns the current statement or null if no statement is active. a JDBC statement
throws:
  JPersistException -



hasNext
public boolean hasNext()(Code)
See same in java.sql.ListIterator
See Also:   java.util.ListIterator



hasPrevious
public boolean hasPrevious()(Code)
See same in java.sql.ListIterator
See Also:   java.util.ListIterator



insertRow
public void insertRow() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



isAfterLast
public boolean isAfterLast() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



isBeforeFirst
public boolean isBeforeFirst() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



isClosed
public boolean isClosed()(Code)
Returns true if the result is closed, false otherwise. true or false



isFirst
public boolean isFirst() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



isLast
public boolean isLast() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



iterator
public Iterator<T> iterator()(Code)
If class (see setClass()) is defined, iteration will return instances of class loaded with the current row of data. returns this



last
public boolean last() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



loadAssociations
public void loadAssociations(Object object) throws JPersistException(Code)
Loads an objects associations.
Parameters:
  object - the object whose associations are to be loaded
throws:
  jpersist.JPersistException -



loadObject
public C loadObject(Class<C> cs) throws JPersistException(Code)
Load an instance of the class (using set methods that match columns in a table matched to the class name) with the results of the current ResultSet row.
Parameters:
  cs - any class with an empty constructor a new instance of cs
throws:
  JPersistException -



loadObject
public C loadObject(Class<C> cs, boolean loadAssociations) throws JPersistException(Code)
Load an instance of the class (using set methods that match columns in a table matched to the class name) with the results of the current ResultSet row.
Parameters:
  cs - any class with an empty constructor
Parameters:
  loadAssociations - true to load associations a new instance of cs
throws:
  JPersistException -



loadObject
public C loadObject(C object) throws JPersistException(Code)
Load the object (using set methods that match columns in a table matched to the class name) with the results of the current ResultSet row.
Parameters:
  object - any Object (POJO, PersistentObject, etc.) the object passed in
throws:
  JPersistException -



loadObject
public C loadObject(C object, boolean loadAssociations) throws JPersistException(Code)
Load the object (using set methods that match columns in a table matched to the class name) with the results of the current ResultSet row.
Parameters:
  object - any Object (POJO, PersistentObject, etc.)
Parameters:
  loadAssociations - true to load associations the object passed in
throws:
  JPersistException -



loadObjects
public Collection<C> loadObjects(Collection<C> collection, Class<C> cs) throws JPersistException(Code)
Loads objects (using set methods that match columns in a table matched to the class name) into a collection with the results of the current ResultSet.
Parameters:
  collection - an instance of Collection (i.e. Vector, Set, etc.)
Parameters:
  cs - any class with an empty constructor the collection passed in
throws:
  JPersistException -



loadObjects
public Collection<C> loadObjects(Collection<C> collection, Class<C> cs, boolean loadAssociations) throws JPersistException(Code)
Loads objects (using set methods that match columns in a table matched to the class name) into a collection with the results of the current ResultSet.
Parameters:
  collection - an instance of Collection (i.e. Vector, Set, etc.)
Parameters:
  cs - any class with an empty constructor
Parameters:
  loadAssociations - true to load associations the collection passed in
throws:
  JPersistException -



moveToCurrentRow
public void moveToCurrentRow() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



moveToInsertRow
public void moveToInsertRow() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



next
public T next()(Code)
Returns the next record. If object is non-null, it is loaded with matching data. If the object is null, then if class is defined, a new instance will be loaded and returned. If object is null and class is not defined, then this (Result) is returned. If there is no next record, then null is returned. This method performs as defined in ListIterator with the following exception: if type is TYPE_FORWARD_ONLY, then null is returned. This allows the next method to perform similar to ResultSet.next(), with next() != null instead of next() != false, which is the case with ResultSet.next(). the loaded object
See Also:   java.util.ListIterator



next
public T next(boolean loadAssociations)(Code)
Returns the next record. If object is non-null, it is loaded with matching data. If the object is null, then if class is defined, a new instance will be loaded and returned. If object is null and class is not defined, then this (Result) is returned. If there is no next record, then null is returned. This method performs as defined in ListIterator with the following exception: if type is TYPE_FORWARD_ONLY, then null is returned. This allows the next method to perform similar to ResultSet.next(), with next() != null instead of next() != false, which is the case with ResultSet.next().
Parameters:
  loadAssociations - load the objects associations the loaded object
See Also:   java.util.ListIterator



next
public T next(T object)(Code)
Returns the next record. If object is non-null, it is loaded with matching data. If the object is null, then if class is defined, a new instance will be loaded and returned. If object is null and class is not defined, then this (Result) is returned. If there is no next record, then null is returned. This method performs as defined in ListIterator with the following exception: if type is TYPE_FORWARD_ONLY, then null is returned. This allows the next method to perform similar to ResultSet.next(), with next() != null instead of next() != false, which is the case with ResultSet.next().
Parameters:
  object - the object to load the loaded object
See Also:   java.util.ListIterator



next
public T next(T object, boolean loadAssociations)(Code)
Returns the next record. If object is non-null, it is loaded with matching data. If the object is null, then if class is defined, a new instance will be loaded and returned. If object is null and class is not defined, then this (Result) is returned. If there is no next record, then null is returned. This method performs as defined in ListIterator with the following exception: if type is TYPE_FORWARD_ONLY, then null is returned. This allows the next method to perform similar to ResultSet.next(), with next() != null instead of next() != false, which is the case with ResultSet.next().
Parameters:
  object - the object to load
Parameters:
  loadAssociations - load the objects associations the loaded object
See Also:   java.util.ListIterator



nextIndex
public int nextIndex()(Code)
See same in java.sql.ListIterator
See Also:   java.util.ListIterator



previous
public T previous()(Code)
Returns the previous record. If object is non-null, it is loaded with matching data. If the object is null, then if class is defined, a new instance will be loaded and returned. If the object is null and class is not defined, then this (Result) is returned. If there is no previous record, then null is returned. the loaded object
See Also:   java.util.ListIterator



previous
public T previous(boolean loadAssociations)(Code)
Returns the previous record. If object is non-null, it is loaded with matching data. If the object is null, then if class is defined, a new instance will be loaded and returned. If the object is null and class is not defined, then this (Result) is returned. If there is no previous record, then null is returned.
Parameters:
  loadAssociations - load the objects associations the loaded object
See Also:   java.util.ListIterator



previous
public T previous(T object)(Code)
Returns the previous record. If object is non-null, it is loaded with matching data. If the object is null, then if class is defined, a new instance will be loaded and returned. If the object is null and class is not defined, then this (Result) is returned. If there is no previous record, then null is returned.
Parameters:
  object - the object to load the loaded object
See Also:   java.util.ListIterator



previous
public T previous(T object, boolean loadAssociations)(Code)
Returns the previous record. If object is non-null, it is loaded with matching data. If the object is null, then if class is defined, a new instance will be loaded and returned. If the object is null and class is not defined, then this (Result) is returned. If there is no previous record, then null is returned.
Parameters:
  object - the object to load
Parameters:
  loadAssociations - load the objects associations the loaded object
See Also:   java.util.ListIterator



previousIndex
public int previousIndex()(Code)
See same in java.sql.ListIterator
See Also:   java.util.ListIterator



refreshRow
public void refreshRow() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



remove
public void remove()(Code)
See same in java.sql.ListIterator
See Also:   java.util.ListIterator



rowDeleted
public boolean rowDeleted() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



rowInserted
public boolean rowInserted() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



rowUpdated
public boolean rowUpdated() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



set
public void set(Object o)(Code)
See same in java.sql.ListIterator. Not supported, and no need to.
throws:
  UnsupportedOperationException -



setClass
public Result setClass(Class<T> cs)(Code)
Setting the class allows next() and previous() to return loaded (with data from the current row) objects of the class.
Parameters:
  cs - the class to create instances for returns this



setClosed
public void setClosed(boolean true_only) throws JPersistException(Code)
Closes the result (simply calls close()), via a JavaBeans setter. For example:
 
 
 

throws:
  JPersistException -



setColumnValue
public void setColumnValue(String columnName, Object object) throws JPersistException(Code)
Sets the object value defined by column name in the current row in the result set.
Parameters:
  columnName - the column name
Parameters:
  object - the object being stored in the database
throws:
  JPersistException -



setColumnValue
public void setColumnValue(int columnIndex, Object object) throws JPersistException(Code)
Sets the object value defined by column index in the current row in the result set.
Parameters:
  columnIndex - the column number
Parameters:
  object - the object being stored in the database
throws:
  JPersistException -



setFetchDirection
public void setFetchDirection(int direction) throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



updateRow
public void updateRow() throws JPersistException(Code)
See same in java.sql.ResultSet
See Also:   java.sql.ResultSet



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.