Java Doc for RowSetDataModel.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » faces » data » 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 » IDE Netbeans » visualweb.api.designer » com.sun.rave.faces.data 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.rave.faces.data.RowSetDataModel

All known Subclasses:   com.sun.jsfcl.data.RowSetDataModel,
RowSetDataModel
public class RowSetDataModel extends DataModel (Code)

Runtime implementation of javax.faces.model.DataModel that caches retrieved database data in memory (in a session scope attribute of type DataCache), even when the underlying rowset is closed.


author:
   craigmcc



Constructor Summary
public  RowSetDataModel()
    
public  RowSetDataModel(RowSet rowSet)
    

Method Summary
public  voidclear()
    

Clear any cached row-specific data.

public  voidcommit()
    

Push any deleted or updated cached rows to the specified table, then call commit() on the JDBC Connection underlying our current RowSet, as well as our associated DataCache.

public  voidexecute()
    

Clear any cached data, then re-execute the query for the rowset we are connected to.

public  DataCachegetDataCache()
    
public  StringgetDataCacheKey()
    

Return the session attribute key under which our DataCache instance will be stored.

public  intgetRowCount()
    
public  ObjectgetRowData()
    

Return a Map representing the column values for the row specified by the current rowIndex.

public  intgetRowIndex()
    
public  RowSetgetRowSet()
    

Return the RowSet we are connected with, if any; otherwise, return null.

public  StringgetSchemaName()
    
public  StringgetTableName()
    
public  ObjectgetWrappedData()
    
public  booleanisRowAvailable()
    
public  voidreset()
    

Reset any deleted or updated values in the cache, so that any cached rows no longer appear to have been modified.

public  voidrollback()
    
public  voidsetDataCacheKey(String dataCacheKey)
    

Set the session attribute key under which our DataCache instance will be stored.

public  voidsetObject(int index, Object value)
    

Set the designated parameter on the RowSet to which we are connected.

public  voidsetObject(int index, Object value, int type)
    

Set the designated parameter on the RowSet to which we are connected.

public  voidsetObject(int index, Object value, int type, int scale)
    

Set the designated parameter on the RowSet to which we are connected.

public  voidsetRowIndex(int rowIndex)
    

Set the zero relative index for the newly positioned row, or set to -1 for no currently selected row.

public  voidsetRowSet(RowSet rowSet)
    

Set the RowSet we are connected with, or pass null to disconnect.

public  voidsetSchemaName(String schemaName)
    
public  voidsetTableName(String tableName)
    
public  voidsetWrappedData(Object rowSet)
    


Constructor Detail
RowSetDataModel
public RowSetDataModel()(Code)

Create a new RowSetDataModel instance not connected to any underlying RowSet.




RowSetDataModel
public RowSetDataModel(RowSet rowSet)(Code)

Create a new RowSetDataModel instance wrapping the specified RowSet.


Parameters:
  rowSet - RowSet to be mapped




Method Detail
clear
public void clear()(Code)

Clear any cached row-specific data. This method may be called by application logic when it is known that the next page to be processed will not involve the RowSet we are connected to, or when the application wants to refresh the cached data to reflect any changes on the underlying database contents.

NOTE - Calling execute() on this RowSetDataModel will implicitly call clear() for you.




commit
public void commit() throws SQLException(Code)

Push any deleted or updated cached rows to the specified table, then call commit() on the JDBC Connection underlying our current RowSet, as well as our associated DataCache. If any SQLException occurs, call rollback() on the Connection() and reset() on the DataCache.


exception:
  IllegalArgumentException - if the tableNameproperty has not yet been set
exception:
  IllegalStateException - if this method is called whennot connected to an underlying rowset
exception:
  SQLException - if an error occurs while committing



execute
public void execute() throws SQLException(Code)

Clear any cached data, then re-execute the query for the rowset we are connected to. WARNING - this method should ONLY be called when you have changed the query parameters for your query, or your application has performed other database transaction(s) on a different page that should be reflected in the query results.


exception:
  IllegalStateException - if this method is called whennot connected to an underlying rowset
exception:
  SQLException - if an error occurs executing the rowset



getDataCache
public DataCache getDataCache()(Code)

Return the DataCache containing our cached row and column data, creating one if necessary.




getDataCacheKey
public String getDataCacheKey()(Code)

Return the session attribute key under which our DataCache instance will be stored.




getRowCount
public int getRowCount()(Code)

Return -1 to indicate that the number of rows available is unknown.




getRowData
public Object getRowData()(Code)

Return a Map representing the column values for the row specified by the current rowIndex. The returned Map supports case-insensitive matching on column names, and records any updates to the column values for later transfer to the database when commit() is called. It does not allow column names (and corresponding values) to be added or removed.


exception:
  IllegalArgumentException - if there is no cacheddata for the current rowIndex



getRowIndex
public int getRowIndex()(Code)

Return the zero-relative index of the currently positioned row, or -1 if we are not positioned on a row.




getRowSet
public RowSet getRowSet()(Code)

Return the RowSet we are connected with, if any; otherwise, return null. This is a type=safe alias for getWrappedData().




getSchemaName
public String getSchemaName()(Code)

Return the name of the database schema containing the table we will update when commit() is called.




getTableName
public String getTableName()(Code)

Return the name of the database table we will update when commit() is called.




getWrappedData
public Object getWrappedData()(Code)

Return the RowSet we are currently wrapping, if any.




isRowAvailable
public boolean isRowAvailable()(Code)

Return true if there is a cache entry for the current rowIndex value.




reset
public void reset()(Code)

Reset any deleted or updated values in the cache, so that any cached rows no longer appear to have been modified. This method has no effect on the connected rowset (if any).




rollback
public void rollback() throws SQLException(Code)

Reset any deleted or updated values in the cache (as is done by the reset() method), then call rollback() on the JDBC Connectino underlying our current RowSet.


exception:
  IllegalStateException - if this method is called whennot connected to an underlying rowset
exception:
  SQLException - if an error occurs while committing



setDataCacheKey
public void setDataCacheKey(String dataCacheKey)(Code)

Set the session attribute key under which our DataCache instance will be stored.
Parameters:
  dataCacheKey - The new key




setObject
public void setObject(int index, Object value) throws SQLException(Code)

Set the designated parameter on the RowSet to which we are connected. This parameter will have no effect on any currently selected rows; it takes effect the next time you call execute().


Parameters:
  index - One-relative parameter index
Parameters:
  value - Value to be set
exception:
  IllegalStateException - if this method is called whennot connected to an underlying rowset
exception:
  SQLException - if an error occurs setting the parameter value



setObject
public void setObject(int index, Object value, int type) throws SQLException(Code)

Set the designated parameter on the RowSet to which we are connected. This parameter will have no effect on any currently selected rows; it takes effect the next time you call execute().


Parameters:
  index - One-relative parameter index
Parameters:
  value - Value to be set
Parameters:
  type - Destination SQL type (as defined in java.sql.Types)
exception:
  IllegalStateException - if this method is called whennot connected to an underlying rowset
exception:
  SQLException - if an error occurs setting the parameter value



setObject
public void setObject(int index, Object value, int type, int scale) throws SQLException(Code)

Set the designated parameter on the RowSet to which we are connected. This parameter will have no effect on any currently selected rows; it takes effect the next time you call execute().


Parameters:
  index - One-relative parameter index
Parameters:
  value - Value to be set
Parameters:
  type - Destination SQL type (as defined in java.sql.Types)
Parameters:
  scale - For java.sql.Types.DECIMAL orjava.sql.Types.NUMERIC types, the number of digitsafter the decimal point (ignored for all other types)
exception:
  IllegalStateException - if this method is called whennot connected to an underlying rowset
exception:
  SQLException - if an error occurs setting the parameter value



setRowIndex
public void setRowIndex(int rowIndex)(Code)

Set the zero relative index for the newly positioned row, or set to -1 for no currently selected row. If there is no current cache entry for this row, but we are currently connected, position the underlying RowSet to the corresponding one-relative row number, and create a new cache entry. In addition, fire a DataModelEvent if needed, per the Javadocs for this method on javax.faces.model.DataModel.


Parameters:
  rowIndex - The row index, or -1 for no selected row
exception:
  FacesException - if an error occurs setting the row index
exception:
  IllegalArgumentException - if rowIndex is less than -1



setRowSet
public void setRowSet(RowSet rowSet)(Code)

Set the RowSet we are connected with, or pass null to disconnect. This is a type-safe alias for setWrappedData().


Parameters:
  rowSet - The RowSet we are connected to,or null to disconnect



setSchemaName
public void setSchemaName(String schemaName)(Code)

Set the name of the database schema containing the table we will update when commit() is called.


Parameters:
  schemaName - The schema name to be updated



setTableName
public void setTableName(String tableName)(Code)

Set the name of the database table we will update when commit() is called.


Parameters:
  tableName - The table name to be updated



setWrappedData
public void setWrappedData(Object rowSet)(Code)

Set the RowSet wrapped by this RowSetDataModel, or null to disconnect from the previously connected RowSet.


Parameters:
  rowSet - RowSet to be wrapped, or nullto disconnect
exception:
  ClassCastException - if this object is not of thecorrect type



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