ca.sqlpower.architect
Enum SQLRelationship.UpdateDeleteRule

java.lang.Object
  extended by java.lang.Enum<SQLRelationship.UpdateDeleteRule>
      extended by ca.sqlpower.architect.SQLRelationship.UpdateDeleteRule
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SQLRelationship.UpdateDeleteRule>
Enclosing class:
SQLRelationship

public static enum SQLRelationship.UpdateDeleteRule
extends java.lang.Enum<SQLRelationship.UpdateDeleteRule>

Enumeration of the various rules allowed for (foreign/imported/child) columns when their parent value is updated or deleted.


Enum Constant Summary
CASCADE
          When parent value changes, child value should be modified to match new parent value.
NO_ACTION
          Modifying or deleting the parent value should fail if there are child records.
RESTRICT
          Modifying or deleting the parent value should fail if there are child records.
SET_DEFAULT
          Modifying or deleting the parent value should cause the child value to be set to its default.
SET_NULL
          The child value will be set to SQL NULL if the parent value is modified or deleted.
 
Method Summary
 int getCode()
          Returns the JDBC code number for this update/delete rule.
static SQLRelationship.UpdateDeleteRule ruleForCode(int code)
          Returns the update/delete rule associated with the given code number.
static SQLRelationship.UpdateDeleteRule valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SQLRelationship.UpdateDeleteRule[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CASCADE

public static final SQLRelationship.UpdateDeleteRule CASCADE
When parent value changes, child value should be modified to match new parent value.


RESTRICT

public static final SQLRelationship.UpdateDeleteRule RESTRICT
Modifying or deleting the parent value should fail if there are child records. This is different from NO_ACTION in that the constraint check will not be deferrable on some platforms.


SET_NULL

public static final SQLRelationship.UpdateDeleteRule SET_NULL
The child value will be set to SQL NULL if the parent value is modified or deleted.


NO_ACTION

public static final SQLRelationship.UpdateDeleteRule NO_ACTION
Modifying or deleting the parent value should fail if there are child records. This is different from RESTRICT in that the constraint checking will be deferrable on some platforms. This is the default update and delete rule on most database platforms.


SET_DEFAULT

public static final SQLRelationship.UpdateDeleteRule SET_DEFAULT
Modifying or deleting the parent value should cause the child value to be set to its default.

Method Detail

values

public static final SQLRelationship.UpdateDeleteRule[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(SQLRelationship.UpdateDeleteRule c : SQLRelationship.UpdateDeleteRule.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static SQLRelationship.UpdateDeleteRule valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

ruleForCode

public static SQLRelationship.UpdateDeleteRule ruleForCode(int code)
Returns the update/delete rule associated with the given code number. The code numbers are defined in the JDBC specification.

Throws:
java.lang.IllegalArgumentException - if the given code number is not valid.

getCode

public int getCode()
Returns the JDBC code number for this update/delete rule.



Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca