/** * Convenience method */ protected AbstractSession getSession() { return this.query.getSession(); }
/** * Convenience method */ protected AbstractSession getSession() { return this.query.getSession(); }
/** * Convenience method */ protected AbstractSession getSession() { return this.query.getSession(); }
/** * INTERNAL: Return the execution session. This is the session used to build * objects returned by the query. */ public AbstractSession getExecutionSession() { if (this.executionSession == null) { if (getSession() != null) { this.executionSession = getSession().getExecutionSession(this); } } return this.executionSession; }
/** * INTERNAL: * Return the execution session. * This is the session used to build objects returned by the query. */ public AbstractSession getExecutionSession() { if (this.executionSession == null) { if (getSession() != null) { this.executionSession = getSession().getExecutionSession(this); } } return this.executionSession; }
/** * INTERNAL: Return the execution session. This is the session used to build * objects returned by the query. */ public AbstractSession getExecutionSession() { if (this.executionSession == null) { if (getSession() != null) { this.executionSession = getSession().getExecutionSession(this); } } return this.executionSession; }
/** * Initialize the query-based value holder. * @param query The query that returns the object when executed. * @param row The row representation of the object. * @param mapping The mapping that is uses batch reading. */ public BatchValueHolder(ReadQuery query, AbstractRecord row, ForeignReferenceMapping mapping, DatabaseQuery originalQuery) { super(query, row, originalQuery.getSession()); this.mapping = mapping; this.argumentRow = originalQuery.getTranslationRow(); }
/** * Creates a new <code>JPQLQueryContext</code>. * * @param query The {@link DatabaseQuery} from which information will be queries * @param jpqlGrammar The JPQL grammar that defines how the JPQL query was parsed * @since 2.5 */ JPQLQueryContext(DatabaseQuery query, JPQLGrammar jpqlGrammar) { this(jpqlGrammar); String jpqlQuery = query.getJPQLString(); cache(query.getSession(), query, parse(jpqlQuery), jpqlQuery); }
/** * Creates a new <code>JPQLQueryContext</code>. * * @param query The {@link DatabaseQuery} from which information will be queries * @param jpqlGrammar The JPQL grammar that defines how the JPQL query was parsed * @since 2.5 */ JPQLQueryContext(DatabaseQuery query, JPQLGrammar jpqlGrammar) { this(jpqlGrammar); String jpqlQuery = query.getJPQLString(); cache(query.getSession(), query, parse(jpqlQuery), jpqlQuery); }
/** * Fetch the locator(s) from the result set and write LOB value to the table */ public void fetchLocatorAndWriteValue(DatabaseCall dbCall, Object resultSet) throws SQLException { Enumeration enumFields = dbCall.getContexts().getFields().elements(); Enumeration enumValues = dbCall.getContexts().getValues().elements(); AbstractSession executionSession = dbCall.getQuery().getSession().getExecutionSession(dbCall.getQuery()); while (enumFields.hasMoreElements()) { DatabaseField field = (DatabaseField)enumFields.nextElement(); Object value = enumValues.nextElement(); //write the value through the locator executionSession.getPlatform().writeLOB(field, value, (ResultSet)resultSet, executionSession); } }
protected Object remoteExecute() { Transporter transporter = ((RemoteSession)getSession()).getRemoteConnection().remoteExecute((DatabaseQuery)this.clone()); return extractRemoteResult(transporter); }
/** * INTERNAL * Used to give the subclasses oportunity to copy aspects of the cloned query * to the original query. */ protected void clonedQueryExecutionComplete(DatabaseQuery query, AbstractSession session) { if (shouldCacheQueryResults()) { // Cached query results must exist on the original query rather than the cloned one setQueryResults(((ReadQuery)query).getTemporaryCachedQueryResults(), query.getTranslationRow(), query.getSession()); } }
/** * INTERNAL * Used to give the subclasses opportunity to copy aspects of the cloned query * to the original query. */ protected void clonedQueryExecutionComplete(DatabaseQuery query, AbstractSession session) { if (shouldCacheQueryResults()) { Object result = ((ReadQuery)query).getTemporaryCachedQueryResults(); // If the temporary results were never set, then don't cache null. if (result != null) { // Cached query results must exist on the original query rather than the cloned one. setQueryResults(result, query.getTranslationRow(), query.getSession()); } } }
/** * INTERNAL * Used to give the subclasses opportunity to copy aspects of the cloned query * to the original query. */ protected void clonedQueryExecutionComplete(DatabaseQuery query, AbstractSession session) { if (shouldCacheQueryResults()) { Object result = ((ReadQuery)query).getTemporaryCachedQueryResults(); // If the temporary results were never set, then don't cache null. if (result != null) { // Cached query results must exist on the original query rather than the cloned one. setQueryResults(result, query.getTranslationRow(), query.getSession()); } } }
/** * INTERNAL: * Use the createRecord method on ObjectBuilder in case the root element is namespace qualified */ protected XMLRecord createXMLRecord(String rootName) { XMLRecord xmlRec; if (getQuery().getDescriptor() != null && getQuery().getDescriptor() instanceof EISDescriptor) { xmlRec = (XMLRecord)((XMLObjectBuilder)this.getQuery().getDescriptor().getObjectBuilder()).createRecord(getInputRootElementName(), getQuery().getSession()); } else { xmlRec = new org.eclipse.persistence.oxm.record.DOMRecord(getInputRootElementName()); xmlRec.setSession(getQuery().getSession()); } return xmlRec; } }
/** * INTERNAL: * Use the createRecord method on ObjectBuilder in case the root element is namespace qualified */ protected XMLRecord createXMLRecord(String rootName) { XMLRecord xmlRec; if (getQuery().getDescriptor() != null && getQuery().getDescriptor() instanceof EISDescriptor) { xmlRec = (XMLRecord)((XMLObjectBuilder)this.getQuery().getDescriptor().getObjectBuilder()).createRecord(getInputRootElementName(), getQuery().getSession()); } else { xmlRec = new org.eclipse.persistence.oxm.record.DOMRecord(getInputRootElementName()); xmlRec.setSession(getQuery().getSession()); } return xmlRec; } }
/** * INTERNAL: * Use the createRecord method on ObjectBuilder in case the root element is namespace qualified */ protected XMLRecord createXMLRecord(String rootName) { XMLRecord xmlRec; if (getQuery().getDescriptor() != null && getQuery().getDescriptor() instanceof EISDescriptor) { xmlRec = (XMLRecord)((XMLObjectBuilder)this.getQuery().getDescriptor().getObjectBuilder()).createRecord(getInputRootElementName(), getQuery().getSession()); } else { xmlRec = new org.eclipse.persistence.oxm.record.DOMRecord(getInputRootElementName()); xmlRec.setSession(getQuery().getSession()); } return xmlRec; } }
/** * 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; }
/** * 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; }
/** * 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; }