/** * Default constructor. */ public EISLogin() { this(new EISPlatform()); }
/** * Stores the field value into the record. * This allows for the platform to perform any platform specific translation or conversion. */ public void setValueInRecord(String key, Object value, MappedRecord record, EISAccessor accessor) { Object recordValue = value; if (shouldConvertDataToStrings() && !(value instanceof Record) && !(value instanceof Collection)) { recordValue = getConversionManager().convertObject(value, ClassConstants.STRING); } record.put(key, recordValue); }
boolean autoCommit = (!isInTransaction()) && getEISPlatform().requiresAutoCommit(); if (autoCommit) { beginTransaction(session); try { interaction = getCCIConnection().createInteraction(); input = getEISPlatform().createInputRecord(eisCall, this); output = getEISPlatform().createOutputRecord(eisCall, translationRow, this); } finally { session.endOperationProfile(SessionProfiler.SqlPrepare, eisCall.getQuery(), SessionProfiler.ALL); try { boolean success = true; InteractionSpec interactionSpec = getEISPlatform().buildInteractionSpec(eisCall); if (output == null) { output = interaction.execute(interactionSpec, input); AbstractRecord outputRow = getEISPlatform().buildRow(output, eisCall, this); if (outputRow != null) { eisCall.getQuery().setProperty("output", outputRow); result = getEISPlatform().buildRow(output, eisCall, this); } else { result = getEISPlatform().buildRows(output, eisCall, this);
/** * Create a DOM input record for this interaction. * Convert the database row or arguments into an XML DOM tree. */ public Record createInputRecord(EISAccessor accessor) { Record record = accessor.getEISPlatform().createDOMRecord(getInputRecordName(), accessor); Element dom = createInputDOM(accessor); accessor.getEISPlatform().setDOMInRecord(dom, record, this, accessor); if (record instanceof XMLRecord) { ((XMLRecord) record).setSession(this.getQuery().getSession()); } return record; }
/** * Build a collection of database rows from the Record returned from the interaction. */ public Vector buildRows(Record record, EISAccessor accessor) { Vector rows = null; if (record == null) { return new Vector(0); } AbstractRecord row = accessor.getEISPlatform().createDatabaseRowFromDOMRecord(record, this, accessor); if (getOutputResultPath().length() > 0) { Vector values = (Vector)row.getValues(getOutputResultPath()); if (values == null) { values = new Vector(0); } rows = values; } else { rows = new Vector(1); rows.add(row); } return rows; }
/** * Add the parameter. * Convert the parameter to a string and write it. * Convert rows to XML strings. */ public void appendParameter(Call call, Writer writer, Object parameter) { if (parameter instanceof Vector) { Vector records = (Vector)parameter; // May be a collection of record. for (int index = 0; index < records.size(); index++) { appendParameter(call, writer, (records).elementAt(index)); } } else if (parameter instanceof org.eclipse.persistence.oxm.record.DOMRecord) { String xml = ((org.eclipse.persistence.oxm.record.DOMRecord)parameter).transformToXML(); // For some reason the transform always prints the XML header, so trim it off. int start = xml.indexOf('>'); xml = xml.substring(start + 1, xml.length()); try { writer.write(xml); } catch (IOException exception) { throw ValidationException.fileError(exception); } } else { super.appendParameter(call, writer, parameter); } }
boolean autoCommit = (!isInTransaction()) && getEISPlatform().requiresAutoCommit(); if (autoCommit) { beginTransaction(session); try { interaction = getCCIConnection().createInteraction(); input = getEISPlatform().createInputRecord(eisCall, this); output = getEISPlatform().createOutputRecord(eisCall, translationRow, this); } finally { session.endOperationProfile(SessionProfiler.SqlPrepare, eisCall.getQuery(), SessionProfiler.ALL); try { boolean success = true; InteractionSpec interactionSpec = getEISPlatform().buildInteractionSpec(eisCall); if (output == null) { output = interaction.execute(interactionSpec, input); AbstractRecord outputRow = getEISPlatform().buildRow(output, eisCall, this); if (outputRow != null) { eisCall.getQuery().setProperty("output", outputRow); result = getEISPlatform().buildRow(output, eisCall, this); } else { result = getEISPlatform().buildRows(output, eisCall, this);
/** * Create a DOM input record for this interaction. * Convert the database row or arguments into an XML DOM tree. */ public Record createInputRecord(EISAccessor accessor) { Record record = accessor.getEISPlatform().createDOMRecord(getInputRecordName(), accessor); Element dom = createInputDOM(accessor); accessor.getEISPlatform().setDOMInRecord(dom, record, this, accessor); if (record instanceof XMLRecord) { ((XMLRecord) record).setSession(this.getQuery().getSession()); } return record; }
/** * Build a collection of database rows from the Record returned from the interaction. */ public Vector buildRows(Record record, EISAccessor accessor) { Vector rows = null; if (record == null) { return new Vector(0); } AbstractRecord row = accessor.getEISPlatform().createDatabaseRowFromDOMRecord(record, this, accessor); if (getOutputResultPath().length() > 0) { Vector values = (Vector)row.getValues(getOutputResultPath()); if (values == null) { values = new Vector(0); } rows = values; } else { rows = new Vector(1); rows.add(row); } return rows; }
/** * Add the parameter. * Convert the parameter to a string and write it. * Convert rows to XML strings. */ public void appendParameter(Call call, Writer writer, Object parameter) { if (parameter instanceof Vector) { Vector records = (Vector)parameter; // May be a collection of record. for (int index = 0; index < records.size(); index++) { appendParameter(call, writer, (records).elementAt(index)); } } else if (parameter instanceof org.eclipse.persistence.oxm.record.DOMRecord) { String xml = ((org.eclipse.persistence.oxm.record.DOMRecord)parameter).transformToXML(); // For some reason the transform always prints the XML header, so trim it off. int start = xml.indexOf('>'); xml = xml.substring(start + 1, xml.length()); try { writer.write(xml); } catch (IOException exception) { throw ValidationException.fileError(exception); } } else { super.appendParameter(call, writer, parameter); } }
boolean autoCommit = (!isInTransaction()) && getEISPlatform().requiresAutoCommit(); if (autoCommit) { beginTransaction(session); try { interaction = getCCIConnection().createInteraction(); input = getEISPlatform().createInputRecord(eisCall, this); output = getEISPlatform().createOutputRecord(eisCall, this); } finally { session.endOperationProfile(SessionProfiler.SQL_PREPARE, eisCall.getQuery(), SessionProfiler.ALL); InteractionSpec interactionSpec = getEISPlatform().buildInteractionSpec(eisCall); if (output == null) { output = interaction.execute(interactionSpec, input); AbstractRecord outputRow = getEISPlatform().buildRow(output, eisCall, this); if (outputRow != null) { eisCall.getQuery().setProperty("output", outputRow); result = getEISPlatform().buildRow(output, eisCall, this); } else { result = getEISPlatform().buildRows(output, eisCall, this);
/** * Stores the field value into the record. * This allows for the platform to perform any platform specific translation or conversion. */ public void setValueInRecord(String key, Object value, MappedRecord record, EISAccessor accessor) { Object recordValue = value; if (shouldConvertDataToStrings()) { recordValue = getConversionManager().convertObject(value, ClassConstants.STRING); } record.put(key, recordValue); }
/** * Create a DOM input record for this interaction. * Convert the database row or arguments into an XML DOM tree. */ public Record createInputRecord(EISAccessor accessor) { Record record = accessor.getEISPlatform().createDOMRecord(getInputRecordName(), accessor); Element dom = createInputDOM(accessor); accessor.getEISPlatform().setDOMInRecord(dom, record, this, accessor); if (record instanceof XMLRecord) { ((XMLRecord) record).setSession(this.getQuery().getSession()); } return record; }
/** * Build a collection of database rows from the Record returned from the interaction. */ public Vector buildRows(Record record, EISAccessor accessor) { Vector rows = null; if (record == null) { return new Vector(0); } AbstractRecord row = accessor.getEISPlatform().createDatabaseRowFromDOMRecord(record, this, accessor); if (getOutputResultPath().length() > 0) { Vector values = (Vector)row.getValues(getOutputResultPath()); if (values == null) { values = new Vector(0); } rows = values; } else { rows = new Vector(1); rows.add(row); } return rows; }
/** * Default constructor. */ public EISLogin() { this(new EISPlatform()); }
/** * Add the parameter. * Convert the parameter to a string and write it. * Convert rows to XML strings. */ public void appendParameter(Call call, Writer writer, Object parameter) { if (parameter instanceof Vector) { Vector records = (Vector)parameter; // May be a collection of record. for (int index = 0; index < records.size(); index++) { appendParameter(call, writer, (records).elementAt(index)); } } else if (parameter instanceof org.eclipse.persistence.oxm.record.DOMRecord) { String xml = ((org.eclipse.persistence.oxm.record.DOMRecord)parameter).transformToXML(); // For some reason the transform always prints the XML header, so trim it off. int start = xml.indexOf('>'); xml = xml.substring(start + 1, xml.length()); try { writer.write(xml); } catch (IOException exception) { throw ValidationException.fileError(exception); } } else { super.appendParameter(call, writer, parameter); } }
/** * Stores the field value into the record. * This allows for the platform to perform any platform specific translation or conversion. */ public void setValueInRecord(String key, Object value, MappedRecord record, EISAccessor accessor) { Object recordValue = value; if (shouldConvertDataToStrings() && !(value instanceof Record) && !(value instanceof Collection)) { recordValue = getConversionManager().convertObject(value, ClassConstants.STRING); } record.put(key, recordValue); }
/** * Build a database row from the record returned from the interaction. */ public AbstractRecord buildRow(Record record, EISAccessor accessor) { if (record == null) { return null; } AbstractRecord row = accessor.getEISPlatform().createDatabaseRowFromDOMRecord(record, this, accessor); if (row == null) { return null; } if (getOutputResultPath().length() > 0) { row = (AbstractRecord)row.get(getOutputResultPath()); // Handle the case were the output row is mapped into a database row of values. } else if (hasOutputArguments()) { row = createXMLRecord(getOutputRootElementName()); for (int index = 0; index < getOutputArgumentNames().size(); index++) { DatabaseField field = (DatabaseField)getOutputArguments().get(index); row.put(field, row.get(getOutputArgumentNames().get(index))); } } return row; }
/** * Default constructor. */ public EISLogin() { this(new EISPlatform()); }
/** * Build a database row from the record returned from the interaction. */ public AbstractRecord buildRow(Record record, EISAccessor accessor) { if (record == null) { return null; } AbstractRecord row = accessor.getEISPlatform().createDatabaseRowFromDOMRecord(record, this, accessor); if (row == null) { return null; } if (getOutputResultPath().length() > 0) { row = (AbstractRecord)row.get(getOutputResultPath()); // Handle the case were the output row is mapped into a database row of values. } else if (hasOutputArguments()) { row = createXMLRecord(getOutputRootElementName()); for (int index = 0; index < getOutputArgumentNames().size(); index++) { DatabaseField field = (DatabaseField)getOutputArguments().get(index); row.put(field, row.get(getOutputArgumentNames().get(index))); } } return row; }