Methods Summary |
---|
public void | addSourceField(java.lang.String sourceField)
getSourceFields().addElement(sourceField);
|
public void | addTargetField(java.lang.String targetField)
getTargetFields().addElement(targetField);
|
public void | appendDBString(java.io.Writer writer, oracle.toplink.essentials.internal.sessions.AbstractSession session)INTERNAL:
Append the database field definition string to the table creation statement.
try {
writer.write("FOREIGN KEY (");
for (Enumeration sourceEnum = getSourceFields().elements();
sourceEnum.hasMoreElements();) {
writer.write((String)sourceEnum.nextElement());
if (sourceEnum.hasMoreElements()) {
writer.write(", ");
}
}
writer.write(") REFERENCES ");
writer.write(getTargetTable());
writer.write(" (");
for (Enumeration targetEnum = getTargetFields().elements();
targetEnum.hasMoreElements();) {
writer.write((String)targetEnum.nextElement());
if (targetEnum.hasMoreElements()) {
writer.write(", ");
}
}
writer.write(")");
if (shouldCascadeOnDelete()) {
writer.write(" ON DELETE CASCADE");
}
} catch (IOException ioException) {
throw ValidationException.fileError(ioException);
}
|
public void | cascadeOnDelete()PUBLIC:
Enables delete cascading on the database.
This must be used carefully, i.e. only private relationships.
setShouldCascadeOnDelete(true);
|
public void | dontCascadeOnDelete()PUBLIC:
Disables delete cascading on the database, this is the default.
setShouldCascadeOnDelete(false);
|
public java.lang.String | getName()
return name;
|
public java.util.Vector | getSourceFields()
return sourceFields;
|
public java.util.Vector | getTargetFields()
return targetFields;
|
public java.lang.String | getTargetTable()
return targetTable;
|
public void | setName(java.lang.String name)
this.name = name;
|
public void | setShouldCascadeOnDelete(boolean shouldCascadeOnDelete)PUBLIC:
Enables delete cascading on the database.
This must be used carefully, i.e. only private relationships.
this.shouldCascadeOnDelete = shouldCascadeOnDelete;
|
public void | setSourceFields(java.util.Vector sourceFields)
this.sourceFields = sourceFields;
|
public void | setTargetFields(java.util.Vector targetFields)
this.targetFields = targetFields;
|
public void | setTargetTable(java.lang.String targetTable)
this.targetTable = targetTable;
|
public boolean | shouldCascadeOnDelete()
return shouldCascadeOnDelete;
|