Search in sources :

Example 1 with AssociationCreateCommand

use of org.jkiss.dbeaver.ext.erd.command.AssociationCreateCommand in project dbeaver by serge-rider.

the class EntityNodeEditPolicy method getConnectionCreateCommand.

/**
	 * @see GraphicalNodeEditPolicy#getConnectionCreateCommand(CreateConnectionRequest)
	 */
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
    AssociationCreateCommand cmd = new AssociationCreateCommand();
    EntityPart part = (EntityPart) getHost();
    cmd.setForeignEntity(part.getTable());
    request.setStartCommand(cmd);
    return cmd;
}
Also used : AssociationCreateCommand(org.jkiss.dbeaver.ext.erd.command.AssociationCreateCommand) EntityPart(org.jkiss.dbeaver.ext.erd.part.EntityPart)

Example 2 with AssociationCreateCommand

use of org.jkiss.dbeaver.ext.erd.command.AssociationCreateCommand in project dbeaver by serge-rider.

the class EntityNodeEditPolicy method getConnectionCompleteCommand.

/**
	 * @see GraphicalNodeEditPolicy#getConnectionCompleteCommand(CreateConnectionRequest)
	 */
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
    AssociationCreateCommand cmd = (AssociationCreateCommand) request.getStartCommand();
    EntityPart part = (EntityPart) request.getTargetEditPart();
    cmd.setPrimaryEntity(part.getTable());
    return cmd;
}
Also used : AssociationCreateCommand(org.jkiss.dbeaver.ext.erd.command.AssociationCreateCommand) EntityPart(org.jkiss.dbeaver.ext.erd.part.EntityPart)

Aggregations

AssociationCreateCommand (org.jkiss.dbeaver.ext.erd.command.AssociationCreateCommand)2 EntityPart (org.jkiss.dbeaver.ext.erd.part.EntityPart)2