Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.ProcedureParameter


    }

    public void createProcedureParameter() {
        Procedure procedure = getProjectController().getCurrentProcedure();

        ProcedureParameter parameter =
            (ProcedureParameter) NamedObjectFactory.createObject(
                ProcedureParameter.class,
                procedure);
               
        procedure.addCallParameter(parameter);
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...?
       
        // first display the stored procedure
View Full Code Here

        }
    }

    protected void removeProcedureParameter() {
        ProjectController mediator = getProjectController();
        ProcedureParameter parameter = mediator.getCurrentProcedureParameter();
        mediator.getCurrentProcedure().removeCallParameter(parameter.getName());

        ProcedureParameterEvent e = new ProcedureParameterEvent(
                Application.getFrame(),
                parameter,
                MapEvent.REMOVE);
View Full Code Here

    public void processExistingSelection(EventObject e) {
        if (e instanceof ChangeEvent){
            table.clearSelection();
        }

        ProcedureParameter parameter = null;
        boolean enableUp = false;
        boolean enableDown = false;
        boolean enableRemoveButton = false;

        int selectedRow = table.getSelectedRow();
View Full Code Here

    }

    public void actionPerformed(ActionEvent e) {
        ProcedureParameterTableModel model =
            (ProcedureParameterTableModel) table.getModel();
        ProcedureParameter parameter = model.getParameter(table.getSelectedRow());
       
        int index = -1;

        if (e.getSource() == moveUp) {
            index = model.moveRowUp(parameter);
        }
        else if (e.getSource() == moveDown) {
            index = model.moveRowDown(parameter);
        }

        if (index >= 0) {
            table.select(index);
           
            // note that 'setCallParameters' is donw by copy internally
            parameter.getProcedure().setCallParameters(model.getObjectList());
            eventController.fireProcedureEvent(
                new ProcedureEvent(this, parameter.getProcedure(), MapEvent.CHANGE));
        }
    }   
View Full Code Here

    public void currentProcedureParameterChanged(ProcedureParameterDisplayEvent e) {
        if (e.getProcedureParameter() == null)
            return;

        ProcedureParameter parameter = e.getProcedureParameter();
        procedureParameterPanel.selectParameter(parameter);
    }
View Full Code Here

            ? (ProcedureParameter) objectList.get(row)
            : null;
    }

    public void setUpdatedValueAt(Object newVal, int rowIndex, int columnIndex) {
        ProcedureParameter parameter = getParameter(rowIndex);

        if (parameter == null) {
            return;
        }

        ProcedureParameterEvent event =
            new ProcedureParameterEvent(eventSource, parameter);
        switch (columnIndex) {
            case PARAMETER_NAME :
                event.setOldName(parameter.getName());
                setParameterName((String) newVal, parameter);
                fireTableCellUpdated(rowIndex, columnIndex);
                break;
            case PARAMETER_DIRECTION :
                setParameterDirection((String) newVal, parameter);
View Full Code Here

    public int getColumnCount() {
        return PARAMETER_INDEXES.length;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        ProcedureParameter parameter = getParameter(rowIndex);

        if (parameter == null) {
            return "";
        }
View Full Code Here

    public void tweakProcedure(Procedure proc) {
        if (DataContextProcedureQueryTest.OUT_STORED_PROCEDURE.equals(proc.getName())
                && proc.getCallParameters().size() == 2) {

            proc.clearCallParameters();
            proc.addCallParameter(new ProcedureParameter(
                    "out_param",
                    Types.INTEGER,
                    ProcedureParameter.OUT_PARAMETER));

            proc.addCallParameter(new ProcedureParameter(
                    "in_param",
                    Types.INTEGER,
                    ProcedureParameter.IN_PARAMETER));
            proc.setReturningValue(true);
        }
View Full Code Here

        if (DataContextProcedureQueryTest.SELECT_STORED_PROCEDURE.equals(proc.getName())
                && proc.getCallParameters().size() == 2) {
            List params = new ArrayList(proc.getCallParameters());

            proc.clearCallParameters();
            proc.addCallParameter(new ProcedureParameter("result", OracleAdapter
                    .getOracleCursorType(), ProcedureParameter.OUT_PARAMETER));
            Iterator it = params.iterator();
            while (it.hasNext()) {
                ProcedureParameter param = (ProcedureParameter) it.next();
                proc.addCallParameter(param);
            }

            proc.setReturningValue(true);
        }
View Full Code Here

TOP

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

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.