/** * INTERNAL * Build the context to be used when generating the expression from the parse tree */ public GenerationContext buildContext(ReadQuery readQuery, AbstractSession session) { GenerationContext contextForGeneration = super.buildContext(readQuery, session); contextForGeneration.setBaseQueryClass(readQuery.getReferenceClass()); return contextForGeneration; }
/** * INTERNAL * Build the context to be used when generating the expression from the parse tree */ public GenerationContext buildContext(ReadQuery readQuery, AbstractSession session) { GenerationContext contextForGeneration = super.buildContext(readQuery, session); contextForGeneration.setBaseQueryClass(readQuery.getReferenceClass()); return contextForGeneration; }
/** * INTERNAL * Build the context to be used when generating the expression from the parse tree */ public GenerationContext buildContext(ReadQuery readQuery, AbstractSession session) { GenerationContext contextForGeneration = super.buildContext(readQuery, session); contextForGeneration.setBaseQueryClass(readQuery.getReferenceClass()); return contextForGeneration; }
/** * INTERNAL * Build the context to be used when generating the expression from the * subquery parse tree. */ private GenerationContext buildSubqueryContext(ReadQuery readQuery, GenerationContext outer) { GenerationContext context = new SelectGenerationContext(outer, this); context.setBaseQueryClass(readQuery.getReferenceClass()); return context; }
/** * INTERNAL * Build the context to be used when generating the expression from the * subquery parse tree. */ private GenerationContext buildSubqueryContext(ReadQuery readQuery, GenerationContext outer) { GenerationContext context = new SelectGenerationContext(outer, this); context.setBaseQueryClass(readQuery.getReferenceClass()); return context; }
/** * INTERNAL * Build the context to be used when generating the expression from the * subquery parse tree. */ private GenerationContext buildSubqueryContext(ReadQuery readQuery, GenerationContext outer) { GenerationContext context = new SelectGenerationContext(outer, this); context.setBaseQueryClass(readQuery.getReferenceClass()); return context; }
/** * INTERNAL: * This is different from 'prepareForExecution' in that this is called on the original query, * and the other is called on the copy of the query. * This query is copied for concurrency so this prepare can only setup things that * will apply to any future execution of this query. * * Clear the query cache when a query is prepared. */ protected void prepare() throws QueryException { super.prepare(); if (shouldCacheQueryResults()) { clearQueryResults(getSession()); if (getReferenceClass() != null) { getQueryResultsCachePolicy().getInvalidationClasses().add(getReferenceClass()); } } }
/** * INTERNAL: * This is different from 'prepareForExecution' in that this is called on the original query, * and the other is called on the copy of the query. * This query is copied for concurrency so this prepare can only setup things that * will apply to any future execution of this query. * * Clear the query cache when a query is prepared. */ protected void prepare() throws QueryException { super.prepare(); if (shouldCacheQueryResults()) { clearQueryResults(getSession()); if (getReferenceClass() != null) { getQueryResultsCachePolicy().getInvalidationClasses().add(getReferenceClass()); } } }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This will be a proxy object. */ public Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session) { ClassDescriptor descriptor = null; try { // Need an instance of the implementing class //CR#3838 descriptor = session.getDescriptor(query.getReferenceClass()); if (descriptor.isDescriptorForInterface()) { descriptor = descriptor.getInterfacePolicy().getChildDescriptors().get(0); } } catch (Exception e) { return null; } ValueHolderInterface valueHolder = new QueryBasedValueHolder(query, row, session); return ProxyIndirectionHandler.newProxyInstance(descriptor.getJavaClass(), targetInterfaces, valueHolder); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This will be a proxy object. */ public Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session) { ClassDescriptor descriptor = null; try { // Need an instance of the implementing class //CR#3838 descriptor = session.getDescriptor(query.getReferenceClass()); if (descriptor.isDescriptorForInterface()) { descriptor = (ClassDescriptor)descriptor.getInterfacePolicy().getChildDescriptors().firstElement(); } } catch (Exception e) { return null; } ValueHolderInterface valueHolder = new QueryBasedValueHolder(query, row, session); return ProxyIndirectionHandler.newProxyInstance(descriptor.getJavaClass(), targetInterfaces, valueHolder); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This will be a proxy object. */ public Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session) { ClassDescriptor descriptor = null; try { // Need an instance of the implementing class //CR#3838 descriptor = session.getDescriptor(query.getReferenceClass()); if (descriptor.isDescriptorForInterface()) { descriptor = descriptor.getInterfacePolicy().getChildDescriptors().get(0); } } catch (Exception e) { return null; } ValueHolderInterface valueHolder = new QueryBasedValueHolder(query, row, session); return ProxyIndirectionHandler.newProxyInstance(descriptor.getJavaClass(), targetInterfaces, valueHolder); }