Java Doc for Constraint.java in  » Database-DBMS » Quadcap-Embeddable-Database » com » quadcap » 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 » Database DBMS » Quadcap Embeddable Database » com.quadcap.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.quadcap.sql.Constraint

All known Subclasses:   com.quadcap.sql.NotNullConstraint,  com.quadcap.sql.ForeignKeyConstraint,  com.quadcap.sql.CheckConstraint,  com.quadcap.sql.IndexConstraint,  com.quadcap.sql.AutoNumberConstraint,
Constraint
abstract public class Constraint implements Externalizable(Code)
A constraint is a condition which must be satisfied relative to the rows of a table. Constraint checking hooks are available for both before and after table-modifying operations.
author:
   Stan Bailes


Field Summary
final public static  intCASCADE
    
final public static  intDEFERRABLE
    
final public static  intDELETE
    
final public static  intFULL
    
final public static  intGLOBAL
    
final public static  intINIT_DEFERRED
    
final public static  intNOACTION
    
final public static  intPARTIAL
    
final public static  intSETDEFAULT
    
final public static  intSETNULL
    
final public static  intUPDATE
    
 VectorcolNames
    
transient  int[]columns
    
 Stringname
    
static  String[]refActions
    
 intspec
    
transient  Tabletable
    

Constructor Summary
public  Constraint()
    
public  Constraint(String name)
    
public  Constraint(String name, Vector colNames)
    

Method Summary
abstract public  voidadd(Session session)
     Called when the constraint is added.
abstract public  voidapplyDelete(Session session, Row row, long rowId, Constraint activeIndex)
     Called after a row has been deleted, with the old row and row ID.
abstract public  voidapplyInsert(Session session, Row row, long rowId, Constraint activeIndex)
     Called after the specified row has been inserted, with the resulting row ID, and with the active index.
abstract public  voidapplyUpdate(Session session, byte[] oldKey, Row row, Row oldRow, long rowId, Constraint activeIndex)
     Called after a row has been updated, with the old row, old key, new row and row ID.
abstract public  voidcheckDelete(Session session, Row row, long rowId)
     ----DELETE Called before a row is DELETED, with an opportunity to signal a constraint violation if one can be detected.
abstract public  voidcheckInsert(Session session, Row row)
     ---INSERT Called before a row is INSERTED, with an opportunity to signal a constraint violation if one can be detected.
abstract public  voidcheckUpdate(Session session, byte[] oldKey, Row row, Row oldRow, long rowId, Constraint activeIndex)
     ----UPDATE Called before a row is UPDATED, with an opportunity to signal a constraint violation if one can be detected.
abstract public  voiddelete(Session session)
     Called when the constraint itself is being removed.
public  ColumngetColumn()
    
public  ColumngetColumn(int c)
    
public  intgetColumnCount()
     Return the number of columns described by the constraint.
public  VectorgetColumnNames()
    
public  int[]getColumns()
     Return the integer indexes in the table's column list of the columns in this constraint.
public  BtreegetIndex(Database db)
     Funny, but a lot of constraints have indexes.
public  StringgetName()
    
public  intgetPriority()
     Higher priority (larger numbers) execute first.
public  intgetRefAction(int opType)
    
public  StringgetRefActionString(int opType)
    
public  intgetSpec()
    
public  TablegetTable()
    
public  booleanisDeferred()
    
public  booleanisGlobal()
    
public  voidreadExternal(ObjectInput in)
    
public  voidresetColumns()
     Reset any mapped columns (e.g.
public  voidsetColumn(Column column)
     Convenience method for setting single column constraints.
public  voidsetDeferrable(int def)
    
public  voidsetGlobal(boolean g)
    
public  voidsetName(String name)
    
public  voidsetRefSpec(int ref)
    
public  voidsetTable(Table table)
    
public  StringtoString()
    
public  voidundoAdd(Session session)
     Called to undo a constraint-add operation.
public  voidundoDelete(Session session)
     Called to undo a constraint-add operation.
public  voidwriteExternal(ObjectOutput out)
    

Field Detail
CASCADE
final public static int CASCADE(Code)



DEFERRABLE
final public static int DEFERRABLE(Code)



DELETE
final public static int DELETE(Code)



FULL
final public static int FULL(Code)



GLOBAL
final public static int GLOBAL(Code)



INIT_DEFERRED
final public static int INIT_DEFERRED(Code)



NOACTION
final public static int NOACTION(Code)



PARTIAL
final public static int PARTIAL(Code)



SETDEFAULT
final public static int SETDEFAULT(Code)



SETNULL
final public static int SETNULL(Code)



UPDATE
final public static int UPDATE(Code)



colNames
Vector colNames(Code)



columns
transient int[] columns(Code)



name
String name(Code)



refActions
static String[] refActions(Code)
String names for Various referential actions



spec
int spec(Code)



table
transient Table table(Code)




Constructor Detail
Constraint
public Constraint()(Code)
Default constructor



Constraint
public Constraint(String name)(Code)
Construct a named constraint



Constraint
public Constraint(String name, Vector colNames)(Code)
Construct a named constraint with a list of columns




Method Detail
add
abstract public void add(Session session) throws SQLException, IOException(Code)
Called when the constraint is added. Constraints which maintain state (e.g., indexes) can build their initial data structures (or whatever it is that they do at this time)



applyDelete
abstract public void applyDelete(Session session, Row row, long rowId, Constraint activeIndex) throws SQLException, IOException(Code)
Called after a row has been deleted, with the old row and row ID. Constraints which maintain state (such as an index) would extend this class and implement this method to update the index.



applyInsert
abstract public void applyInsert(Session session, Row row, long rowId, Constraint activeIndex) throws SQLException, IOException(Code)
Called after the specified row has been inserted, with the resulting row ID, and with the active index. Constraints which maintain state (such as an index) would extend this class and implement this method to update the index



applyUpdate
abstract public void applyUpdate(Session session, byte[] oldKey, Row row, Row oldRow, long rowId, Constraint activeIndex) throws SQLException, IOException(Code)
Called after a row has been updated, with the old row, old key, new row and row ID. Constraints which maintain state (such as an index) would extend this class and implement this method to update the index.



checkDelete
abstract public void checkDelete(Session session, Row row, long rowId) throws SQLException, IOException(Code)
----DELETE Called before a row is DELETED, with an opportunity to signal a constraint violation if one can be detected.



checkInsert
abstract public void checkInsert(Session session, Row row) throws SQLException, IOException(Code)
---INSERT Called before a row is INSERTED, with an opportunity to signal a constraint violation if one can be detected.



checkUpdate
abstract public void checkUpdate(Session session, byte[] oldKey, Row row, Row oldRow, long rowId, Constraint activeIndex) throws SQLException, IOException(Code)
----UPDATE Called before a row is UPDATED, with an opportunity to signal a constraint violation if one can be detected. Because the oldRow may be 'lazy', it's important to instantiate whatever items are going to be needed later by applyUpdate *now*, otherwise, apply may get the 'new' versions of those items, because the underlying byte stream is modified by the time applyUpdate gets called.



delete
abstract public void delete(Session session) throws SQLException, IOException(Code)
Called when the constraint itself is being removed. Constraints which allocate resources of any kind should release them here since they are about to be discarded and gc'ed.



getColumn
public Column getColumn() throws SQLException(Code)
For the simple, single column constraint, the constraint's column
exception:
  SQLException - if called for a multi-column constraint.



getColumn
public Column getColumn(int c) throws SQLException(Code)
Zero based!!!!



getColumnCount
public int getColumnCount()(Code)
Return the number of columns described by the constraint.



getColumnNames
public Vector getColumnNames() throws SQLException(Code)
Return a vector containing all of the column names



getColumns
public int[] getColumns() throws SQLException(Code)
Return the integer indexes in the table's column list of the columns in this constraint. We return a copy of our internal array, for speed, and trust the caller to not mess with the array...



getIndex
public Btree getIndex(Database db) throws IOException(Code)
Funny, but a lot of constraints have indexes. For the ones that do, this can be a nifty little function.



getName
public String getName()(Code)
Return the constraint's name



getPriority
public int getPriority()(Code)
Higher priority (larger numbers) execute first.



getRefAction
public int getRefAction(int opType)(Code)
Get the referential action for the specified operation (UPD OR DEL)



getRefActionString
public String getRefActionString(int opType)(Code)
Return the referential action for the specified operation



getSpec
public int getSpec()(Code)
Return the referential integrity and deferrability flags



getTable
public Table getTable()(Code)
Get the constraint's table



isDeferred
public boolean isDeferred()(Code)
Is this constraint 'deferred'?



isGlobal
public boolean isGlobal()(Code)
Get the 'global' flag



readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException(Code)
Read me from a stream



resetColumns
public void resetColumns() throws SQLException(Code)
Reset any mapped columns (e.g. in case a column is added or deleted)



setColumn
public void setColumn(Column column)(Code)
Convenience method for setting single column constraints.



setDeferrable
public void setDeferrable(int def)(Code)
Set the deferrable flags



setGlobal
public void setGlobal(boolean g)(Code)
Set the 'global' flag



setName
public void setName(String name)(Code)
Set the constraint's name



setRefSpec
public void setRefSpec(int ref)(Code)
Set the referential integrity flags



setTable
public void setTable(Table table) throws SQLException(Code)
Set the contstraint's table



toString
public String toString()(Code)
Return a displayable representation for debugging



undoAdd
public void undoAdd(Session session) throws SQLException, IOException(Code)
Called to undo a constraint-add operation.



undoDelete
public void undoDelete(Session session) throws SQLException, IOException(Code)
Called to undo a constraint-add operation.



writeExternal
public void writeExternal(ObjectOutput out) throws IOException(Code)
Write me to a stream



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.