net.java.ao.schema.ddl.DDLActions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of activeobjects-core Show documentation
Show all versions of activeobjects-core Show documentation
This is the core library for Active Objects. It is generic and can be embedded in any environment.
As such it is generic and won't contain all connection pooling, etc.
package net.java.ao.schema.ddl;
import static net.java.ao.schema.ddl.DDLActionType.ALTER_ADD_KEY;
import static net.java.ao.schema.ddl.DDLActionType.INSERT;
/**
* A utility class to manipulate {@link net.java.ao.schema.ddl.DDLAction DDL Actions}.
* Do not instantiate.
*/
public final class DDLActions {
private DDLActions() {
}
public static DDLAction newAlterAddKey(DDLForeignKey key) {
final DDLAction action = newAction(ALTER_ADD_KEY);
action.setKey(key);
return action;
}
public static DDLAction newInsert(DDLTable table, DDLValue[] values) {
final DDLAction action = newAction(INSERT);
action.setTable(table);
action.setValues(values);
return action;
}
private static DDLAction newAction(DDLActionType actionType) {
return new DDLAction(actionType);
}
}