Package org.datanucleus.metadata
Class ForeignKeyAction
java.lang.Object
org.datanucleus.metadata.ForeignKeyAction
- All Implemented Interfaces:
Serializable
Foreign 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ForeignKeyAction
update/delete-action="cascade".static final ForeignKeyAction
update/delete-action="default".static final ForeignKeyAction
update/delete-action="none".static final ForeignKeyAction
update/delete-action="null".static final ForeignKeyAction
update/delete-action="restrict".private static final long
private final int
The type id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static ForeignKeyAction
getForeignKeyAction
(String value) Return ForeignKeyDeleteAction from String.protected int
getType()
Accessor for the type.int
hashCode()
toString()
Returns a string representation of the object.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
CASCADE
update/delete-action="cascade". The database will automatically delete all rows that refer to the row being deleted -
RESTRICT
update/delete-action="restrict". The user is required to explicitly make the relationship valid by application code -
NULL
update/delete-action="null". The database will automatically nullify the columns in all rows that refer to the row being deleted -
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
update/delete-action="none". No foreign-key should be created. -
typeId
private final int typeIdThe type id
-
-
Constructor Details
-
ForeignKeyAction
protected ForeignKeyAction(int i) constructor- Parameters:
i
- type id
-
-
Method Details
-
toString
Returns a string representation of the object. -
hashCode
public int hashCode() -
equals
-
getType
protected int getType()Accessor for the type.- Returns:
- The type
-
getForeignKeyAction
Return ForeignKeyDeleteAction from String.- Parameters:
value
- delete-action attribute value- Returns:
- Instance of ForeignKeyDeleteAction. If value invalid, return null.
-