📄 dbconstraint.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Wed Jan 15 11:28:11 CET 2003 --><TITLE>DbConstraint</TITLE><META NAME="keywords" CONTENT="javatools.db.DbConstraint,DbConstraint class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><SCRIPT>function asd(){parent.document.title="DbConstraint";}</SCRIPT><BODY BGCOLOR="white" onload="asd();"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javatools/db/DbConnection.html"><B>PREV CLASS</B></A> <A HREF="../../javatools/db/DbCriterion.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="DbConstraint.html" TARGET="_top"><B>NO FRAMES</B></A> <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javatools.db</FONT><BR>Class DbConstraint</H2><PRE>java.lang.Object | +--<B>javatools.db.DbConstraint</B></PRE><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../javatools/db/DbDynamicConstraint.html">DbDynamicConstraint</A>, <A HREF="../../medi/db/constraint/FKAuthor.html">FKAuthor</A>, <A HREF="../../medi/db/constraint/FKAuthorTelephoneNo.html">FKAuthorTelephoneNo</A>, <A HREF="../../medi/db/constraint/FKContainer.html">FKContainer</A>, <A HREF="../../medi/db/constraint/FKContains.html">FKContains</A>, <A HREF="../../medi/db/constraint/FKData.html">FKData</A>, <A HREF="../../medi/db/constraint/FKDataSet.html">FKDataSet</A>, <A HREF="../../medi/db/constraint/FKEditor.html">FKEditor</A>, <A HREF="../../medi/db/constraint/FKEditorTelephoneNo.html">FKEditorTelephoneNo</A>, <A HREF="../../medi/db/constraint/FKFatherOf.html">FKFatherOf</A>, <A HREF="../../medi/db/constraint/FKFileType.html">FKFileType</A>, <A HREF="../../medi/db/constraint/FKGenre.html">FKGenre</A>, <A HREF="../../medi/db/constraint/FKIncludes.html">FKIncludes</A>, <A HREF="../../medi/db/constraint/FKInstalledProgram.html">FKInstalledProgram</A>, <A HREF="../../medi/db/constraint/FKMarks.html">FKMarks</A>, <A HREF="../../medi/db/constraint/FKNeedsExecutionOf.html">FKNeedsExecutionOf</A>, <A HREF="../../medi/db/constraint/FKPublished.html">FKPublished</A>, <A HREF="../../medi/db/constraint/FKRealized.html">FKRealized</A>, <A HREF="../../medi/db/constraint/FKSession.html">FKSession</A>, <A HREF="../../medi/db/constraint/FKVolume.html">FKVolume</A></DD></DL><HR><DL><DT>public abstract class <B>DbConstraint</B><DT>extends java.lang.Object</DL><P>This abstract class represents a generic set of constraints for a table. It contains a lot of code already written for generic purposes, i.e. it can be derived with few code. If you want to add additional checks, you can easily add your own code, rewriting <CODE>check</CODE> and <CODE>update</CODE> methods.<P><P><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#automaticChecking">automaticChecking</A></B></CODE><BR> <CODE>true</CODE>: check is done at all times; <CODE>false</CODE>: check is performed only with an explicit call to <CODE>check</CODE>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#canDoUpdate">canDoUpdate</A></B></CODE><BR> <CODE>true</CODE>: update can be done. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#CASCADE">CASCADE</A></B></CODE><BR> It means that, in case of an UPDATE/DELETE operation, the constraint MUST cascade the operation, that is updating/deleting in cascade all involved rows.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#cloned">cloned</A></B></CODE><BR> <CODE>true</CODE>: the object is cloned. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#constraintEmulation">constraintEmulation</A></B></CODE><BR> <CODE>true</CODE>: emulation made as needed; <CODE>false</CODE>: emulation is not made.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../javatools/db/DbConstraint.html">DbConstraint</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#constraints">constraints</A></B></CODE><BR> Contains an array of constraint to perform cascade-check and cascade-updates.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#currentOperation">currentOperation</A></B></CODE><BR> Represents the current operation. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.Object[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#defaultValues">defaultValues</A></B></CODE><BR> Contains default values for each referenced field of each father table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#DELETE_OPERATION">DELETE_OPERATION</A></B></CODE><BR> It represents a DELETE operation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.Integer[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#deleteCascadeChildren">deleteCascadeChildren</A></B></CODE><BR> Currently unused.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.Integer[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#deleteOperations">deleteOperations</A></B></CODE><BR> It contains the delete operations for each father table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#DO_NOTHING">DO_NOTHING</A></B></CODE><BR> It means that, in case of an UPDATE/DELETE operation, the table MUST NOT do anything to repair itself.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../javatools/db/DbColumn.html">DbColumn</A>[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#fatherColsChildren">fatherColsChildren</A></B></CODE><BR> For each son, it contains the referenced column of THIS table. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../javatools/db/DbTable.html">DbTable</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#fatherRecords">fatherRecords</A></B></CODE><BR> Contains the father records used to find eventually involved rows.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../javatools/db/DbAbstractTable.html">DbAbstractTable</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#fatherTables">fatherTables</A></B></CODE><BR> It contains all father tables of the one referenced by this constraint.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../javatools/db/DbColumn.html">DbColumn</A>[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#fatherTablesColumns">fatherTablesColumns</A></B></CODE><BR> It contains the father keys for each father table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.util.List</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#fromList">fromList</A></B></CODE><BR> A list of values/expression to put data into (used in INSERT/UPDATE operations).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#INSERT_OPERATION">INSERT_OPERATION</A></B></CODE><BR> It represents an INSERT operation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.util.List</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#intoList">intoList</A></B></CODE><BR> A list of columns to put data into (used in INSERT/UPDATE operations).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../javatools/db/DbColumn.html">DbColumn</A>[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#refColsChildren">refColsChildren</A></B></CODE><BR> For each son it contains the referenced columns of son tables. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../javatools/db/DbColumn.html">DbColumn</A>[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#refColumns">refColumns</A></B></CODE><BR> It contains for each father table, the referenced column in contained table. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.Integer[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#refs">refs</A></B></CODE><BR> It's an array built at runtime to represent, for each father, the referenced fields if they are specified in <CODE>intoList</CODE> for INSERT or UPDATE operations.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.util.TreeSet[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#searchSets">searchSets</A></B></CODE><BR> Contains the search sets used to perform checks for each son table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../javatools/db/DbSelector.html">DbSelector</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#selector">selector</A></B></CODE><BR> A selector used in INSERT operations.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#SET_DEFAULT">SET_DEFAULT</A></B></CODE><BR> It means that, in case of an UPDATE/DELETE operation, the constraint MUST set an array of fields in involved rows to DEFAULT values, to repair referenced table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#SET_NULL">SET_NULL</A></B></CODE><BR> It means that, in case of an UPDATE/DELETE operation, the constraint MUST set an array of fields in involved rows to NULL values, to repair referenced table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.Integer[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#sonIndexes">sonIndexes</A></B></CODE><BR> For each son, it contains the position in the <CODE>fatherTables</CODE> of the son table itself.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../javatools/db/DbExpr.html">DbExpr</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/db/DbConstraint.html#sonsWhere">sonsWhere</A></B></CODE><BR> Contains the "where" clauses for each son.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -