Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.Procedure


    /**
     * Invoked when currently selected Procedure object is changed.
     */
    public synchronized void currentProcedureChanged(ProcedureDisplayEvent e) {
        Procedure procedure = e.getProcedure();
        if (procedure == null || !e.isProcedureChanged()) {
            return;
        }

        name.setText(procedure.getName());
        schema.setText(procedure.getSchema());

        ignoreChange = true;
        returnsValue.setSelected(procedure.isReturningValue());
        ignoreChange = false;
    }
View Full Code Here


    void setProcedureName(String newName) {
        if (newName != null && newName.trim().length() == 0) {
            newName = null;
        }

        Procedure procedure = eventController.getCurrentProcedure();

        if (procedure == null || Util.nullSafeEquals(newName, procedure.getName())) {
            return;
        }

        if (newName == null) {
            throw new ValidationException("Procedure name is required.");
        }
        else if (procedure.getDataMap().getProcedure(newName) == null) {
            // completely new name, set new name for entity
            ProcedureEvent e = new ProcedureEvent(this, procedure, procedure.getName());
            ProjectUtil.setProcedureName(procedure.getDataMap(), procedure, newName);
            eventController.fireProcedureEvent(e);
        }
        else {
            // there is an entity with the same name
            throw new ValidationException("There is another procedure with name '"
View Full Code Here

    void setSchema(String text) {
        if (text != null && text.trim().length() == 0) {
            text = null;
        }

        Procedure procedure = eventController.getCurrentProcedure();

        if (procedure != null && !Util.nullSafeEquals(procedure.getSchema(), text)) {
            procedure.setSchema(text);
            eventController.fireProcedureEvent(new ProcedureEvent(this, procedure));
        }
    }
View Full Code Here

    public void displayField(ProjectController mediator, JFrame frame) {
    ProjectPath path = super.validationInfo.getPath();
    DataDomain domain = (DataDomain)path.firstInstanceOf(DataDomain.class);
    DataMap map = (DataMap)path.firstInstanceOf(DataMap.class);
    Procedure procedure = (Procedure)path.firstInstanceOf(Procedure.class);
 
        ProcedureDisplayEvent event =
            new ProcedureDisplayEvent(frame, procedure, map, domain);
        event.setTabReset(true);
        mediator.fireProcedureDisplayEvent(event);
View Full Code Here

        super(getActionName(), application);
    }

    public void performAction(ActionEvent e) {
        ProjectController mediator = getProjectController();
        Procedure procedure = createProcedure(mediator.getCurrentDataMap());

        mediator.fireProcedureEvent(new ProcedureEvent(this, procedure, MapEvent.ADD));
        mediator.fireProcedureDisplayEvent(new ProcedureDisplayEvent(
                this,
                procedure,
View Full Code Here

                mediator.getCurrentDataMap(),
                mediator.getCurrentDataDomain()));
    }

    protected Procedure createProcedure(DataMap map) {
        Procedure procedure = (Procedure) NamedObjectFactory.createObject(
                Procedure.class,
                map);
        procedure.setSchema(map.getDefaultSchema());

        map.addProcedure(procedure);
        return procedure;
    }
View Full Code Here

    /**
     * Removes current Procedure from its DataMap and fires "remove" ProcedureEvent.
     */
    protected void removeProcedure() {
        ProjectController mediator = getProjectController();
        Procedure procedure = mediator.getCurrentProcedure();
        DataMap map = mediator.getCurrentDataMap();
        map.removeProcedure(procedure.getName());
        mediator.fireProcedureEvent(new ProcedureEvent(
                Application.getFrame(),
                procedure,
                MapEvent.REMOVE));
    }
View Full Code Here

    public void displayField(ProjectController mediator, JFrame frame) {
        ProjectPath path = super.validationInfo.getPath();
        DataDomain domain = (DataDomain) path.firstInstanceOf(DataDomain.class);
        DataMap map = (DataMap) path.firstInstanceOf(DataMap.class);
        Procedure procedure = (Procedure) path.firstInstanceOf(Procedure.class);
        ProcedureParameter procedureParameter =
            (ProcedureParameter) path.firstInstanceOf(ProcedureParameter.class);

        // Race condition between the two events...?
       
View Full Code Here

        // If name hasn't changed, just return
        if (Util.nullSafeEquals(oldName, newName)) {
            return;
        }

        Procedure procedure = parameter.getProcedure();
        procedure.removeCallParameter(parameter.getName());
        parameter.setName(newName);
        procedure.addCallParameter(parameter);
    }
View Full Code Here

    /**
      * Invoked when currently selected Procedure object is changed.
      */
    public void currentProcedureChanged(ProcedureDisplayEvent e) {
        Procedure procedure = e.getProcedure();
        if (procedure != null && e.isProcedureChanged()) {
            rebuildTable(procedure);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.map.Procedure

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.