Package org.datanucleus.metadata
Class ForeignKeyAction
- java.lang.Object
-
- org.datanucleus.metadata.ForeignKeyAction
-
- All Implemented Interfaces:
java.io.Serializable
public class ForeignKeyAction extends java.lang.Object implements java.io.SerializableForeign keys represent a consistency constraint in the database that must be maintained. This class enumerates the actions which happens when foreign-keys are updated or deleted.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ForeignKeyActionCASCADEupdate/delete-action="cascade".static ForeignKeyActionDEFAULTupdate/delete-action="default".static ForeignKeyActionNONEupdate/delete-action="none".static ForeignKeyActionNULLupdate/delete-action="null".static ForeignKeyActionRESTRICTupdate/delete-action="restrict".private static longserialVersionUIDprivate inttypeIdThe type id
-
Constructor Summary
Constructors Modifier Constructor Description protectedForeignKeyAction(int i)constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)static ForeignKeyActiongetForeignKeyAction(java.lang.String value)Return ForeignKeyDeleteAction from String.protected intgetType()Accessor for the type.inthashCode()java.lang.StringtoString()Returns a string representation of the object.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
CASCADE
public static final ForeignKeyAction CASCADE
update/delete-action="cascade". The database will automatically delete all rows that refer to the row being deleted
-
RESTRICT
public static final ForeignKeyAction RESTRICT
update/delete-action="restrict". The user is required to explicitly make the relationship valid by application code
-
NULL
public static final ForeignKeyAction NULL
update/delete-action="null". The database will automatically nullify the columns in all rows that refer to the row being deleted
-
DEFAULT
public static final ForeignKeyAction DEFAULT
update/delete-action="default". The database will automatically set the columns in all rows that refer to the row being deleted to their default value
-
NONE
public static final ForeignKeyAction NONE
update/delete-action="none". No foreign-key should be created.
-
typeId
private final int typeId
The type id
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a string representation of the object.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the object.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
getType
protected int getType()
Accessor for the type.- Returns:
- The type
-
getForeignKeyAction
public static ForeignKeyAction getForeignKeyAction(java.lang.String value)
Return ForeignKeyDeleteAction from String.- Parameters:
value- delete-action attribute value- Returns:
- Instance of ForeignKeyDeleteAction. If value invalid, return null.
-
-