Java Doc for DBTable.java in  » Groupware » hipergate » com » knowgate » dataobjs » 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 » Groupware » hipergate » com.knowgate.dataobjs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.knowgate.dataobjs.DBTable

All known Subclasses:   com.knowgate.hipergate.datamodel.TableLoader,
DBTable
public class DBTable (Code)

A database table as a Java Object


author:
   Sergio Montoro Ten
version:
   3.0



Constructor Summary
public  DBTable(String sTableName)
    

Constructor

Catalog and schema names are set to null.
Table index is set to 1.
public  DBTable(String sCatalogName, String sSchemaName, String sTableName, int iIndex)
    

Method Summary
public  intcolumnCount()
    
public  booleandeleteRegister(JDCConnection oConn, HashMap AllValues)
    

Delete a single register from this table at the database


Parameters:
  oConn - Database connection
Parameters:
  AllValues - A Map with, at least, the primary key values for the register.
public  booleanexistsRegister(JDCConnection oConn, String sQueryString)
    
public  booleanexistsRegister(JDCConnection oConn, String sQueryString, Object[] oQueryParams)
    
public  booleanexistsRegister(JDCConnection oConn, HashMap AllValues)
    
public  StringgetCatalog()
    
public  DBColumngetColumnByName(String sColumnName)
    
public  intgetColumnIndex(String sColumnName)
    
public  LinkedListgetColumns()
    
public  StringgetColumnsStr()
    
public  StringgetName()
    
public  LinkedListgetPrimaryKey()
    
public  StringgetSchema()
    
public  inthashCode()
    
public  booleanloadRegister(JDCConnection oConn, Object[] PKValues, HashMap AllValues)
    

Load a single table register into a Java HashMap


Parameters:
  oConn - Database Connection
Parameters:
  PKValues - Primary key values of register to be readed, in the same order as they appear in table source.
Parameters:
  AllValues - Output parameter.
public  voidreadColumns(Connection oConn, DatabaseMetaData oMData)
    

Read DBColumn List from DatabaseMetaData

This is primarily an internal initialization method for DBTable object.
public  voidsetCatalog(String sCatalogName)
    
public  voidsetSchema(String sSchemaName)
    
public  booleanstoreRegister(JDCConnection oConn, HashMap AllValues)
    

Store a single register at the database representing a Java Object

for register containing LONGVARBINARY, IMAGE, BYTEA or BLOB fields use storeRegisterLong() method. Columns named "dt_created" are invisible for storeRegister() method so that register creation timestamp is not altered by afterwards updates.
Parameters:
  oConn - Database Connection
Parameters:
  AllValues - Values to assign to fields.
public  booleanstoreRegisterLong(JDCConnection oConn, HashMap AllValues, HashMap BinaryLengths)
    

Store a single register at the database representing a Java Object

for register NOT containing LONGVARBINARY, IMAGE, BYTEA or BLOB fields use storeRegister() method witch is faster than storeRegisterLong(). Columns named "dt_created" are invisible for storeRegisterLong() method so that register creation timestamp is not altered by afterwards updates.
Parameters:
  oConn - Database Connection
Parameters:
  AllValues - Values to assign to fields.
Parameters:
  BinaryLengths - map of lengths for long fields.


Constructor Detail
DBTable
public DBTable(String sTableName)(Code)

Constructor

Catalog and schema names are set to null.
Table index is set to 1.
Parameters:
  sSchemaName - Database schema name



DBTable
public DBTable(String sCatalogName, String sSchemaName, String sTableName, int iIndex)(Code)
Constructor
Parameters:
  sCatalogName - Database catalog name
Parameters:
  sSchemaName - Database schema name
Parameters:
  sTableName - Database table name (not qualified)
Parameters:
  iIndex - Ordinal number identifier for table




Method Detail
columnCount
public int columnCount() throws IllegalStateException(Code)
Column Count for this table
throws:
  IllegalStateException - if columns list has not been initialized



deleteRegister
public boolean deleteRegister(JDCConnection oConn, HashMap AllValues) throws SQLException(Code)

Delete a single register from this table at the database


Parameters:
  oConn - Database connection
Parameters:
  AllValues - A Map with, at least, the primary key values for the register. Other Map values are ignored. true if register was delete, false if register to be deleted was not found.
throws:
  SQLException -



existsRegister
public boolean existsRegister(JDCConnection oConn, String sQueryString) throws SQLException(Code)

Checks if register exists at this table


Parameters:
  oConn - Database Connection
Parameters:
  sQueryString - Register Query String, as a SQL WHERE clause syntax true if register exists, false otherwise.
throws:
  SQLException -



existsRegister
public boolean existsRegister(JDCConnection oConn, String sQueryString, Object[] oQueryParams) throws SQLException(Code)

Checks if register exists at this table


Parameters:
  oConn - Database Connection
Parameters:
  sQueryString - Register Query String, as a SQL WHERE clause syntax true if register exists, false otherwise.
throws:
  SQLException -



existsRegister
public boolean existsRegister(JDCConnection oConn, HashMap AllValues) throws SQLException(Code)

Checks if register exists at this table


Parameters:
  oConn - Database Connection true if register exists, false otherwise.
throws:
  SQLException -



getCatalog
public String getCatalog()(Code)
Catalog name



getColumnByName
public DBColumn getColumnByName(String sColumnName) throws IllegalStateException(Code)

Get DBColumn by name


Parameters:
  sColumnName - Column Name Reference to DBColumn ot null if no column with such name was found.
throws:
  IllegalStateException - If column list for table has not been initialized



getColumnIndex
public int getColumnIndex(String sColumnName)(Code)

Get DBColumn index given its by name


Parameters:
  sColumnName - Column Name Column Index[1..columnsCount()] or -1 if no column with such name was found.



getColumns
public LinkedList getColumns()(Code)
List of DBColumn objects composing this table.



getColumnsStr
public String getColumnsStr() throws IllegalStateException(Code)
Columns names separated by commas
throws:
  IllegalStateException -



getName
public String getName()(Code)
Unqualified table name



getPrimaryKey
public LinkedList getPrimaryKey()(Code)
List of primary key column names



getSchema
public String getSchema()(Code)
Schema name



hashCode
public int hashCode()(Code)



loadRegister
public boolean loadRegister(JDCConnection oConn, Object[] PKValues, HashMap AllValues) throws SQLException, NullPointerException, IllegalStateException(Code)

Load a single table register into a Java HashMap


Parameters:
  oConn - Database Connection
Parameters:
  PKValues - Primary key values of register to be readed, in the same order as they appear in table source.
Parameters:
  AllValues - Output parameter. Readed values. true if register was found false otherwise.
throws:
  NullPointerException - If all objects in PKValues array are null (only debug version)
throws:
  IllegalStateException - if columns list has not been initialized
throws:
  SQLException -



readColumns
public void readColumns(Connection oConn, DatabaseMetaData oMData) throws SQLException(Code)

Read DBColumn List from DatabaseMetaData

This is primarily an internal initialization method for DBTable object. Usually there is no need to call it from any other class.
Parameters:
  oConn - Database Connection
Parameters:
  oMData - DatabaseMetaData
throws:
  SQLException -



setCatalog
public void setCatalog(String sCatalogName)(Code)



setSchema
public void setSchema(String sSchemaName)(Code)
Set schema name
Parameters:
  sSchemaName - String



storeRegister
public boolean storeRegister(JDCConnection oConn, HashMap AllValues) throws SQLException(Code)

Store a single register at the database representing a Java Object

for register containing LONGVARBINARY, IMAGE, BYTEA or BLOB fields use storeRegisterLong() method. Columns named "dt_created" are invisible for storeRegister() method so that register creation timestamp is not altered by afterwards updates.
Parameters:
  oConn - Database Connection
Parameters:
  AllValues - Values to assign to fields. true if register was inserted for first time, if it was updated.
throws:
  SQLException -



storeRegisterLong
public boolean storeRegisterLong(JDCConnection oConn, HashMap AllValues, HashMap BinaryLengths) throws IOException, SQLException(Code)

Store a single register at the database representing a Java Object

for register NOT containing LONGVARBINARY, IMAGE, BYTEA or BLOB fields use storeRegister() method witch is faster than storeRegisterLong(). Columns named "dt_created" are invisible for storeRegisterLong() method so that register creation timestamp is not altered by afterwards updates.
Parameters:
  oConn - Database Connection
Parameters:
  AllValues - Values to assign to fields.
Parameters:
  BinaryLengths - map of lengths for long fields. true if register was inserted for first time, if it was updated.
throws:
  SQLException -



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.