/** * PUBLIC: * Specify that only a subset of the class' attributes be selected in this query. * <p>This allows for the query to be optimized through selecting less data. * <p>Partial objects will be returned from the query, where the unspecified attributes will be left <code>null</code>. * The primary key will always be selected to allow re-querying of the whole object. * <p>Note: Because the object is not fully initialized it cannot be cached, and cannot be edited. * <p>Note: You cannot have 2 partial attributes of the same type. You also cannot * add a partial attribute which is of the same type as the class being queried. * <p><b>Example</b>: query.addPartialAttribute(query.getExpressionBuilder().get("address").get("city")) */ public void addPartialAttribute(Expression attributeExpression) { getPartialAttributeExpressions().add(attributeExpression); //Bug2804042 Must un-prepare if prepared as the SQL may change. setIsPrepared(false); }
/** * PUBLIC: * Specify that only a subset of the class' attributes be selected in this query. * <p>This allows for the query to be optimized through selecting less data. * <p>Partial objects will be returned from the query, where the unspecified attributes will be left <code>null</code>. * The primary key will always be selected to allow re-querying of the whole object. * <p>Note: Because the object is not fully initialized it cannot be cached, and cannot be edited. * <p>Note: You cannot have 2 partial attributes of the same type. You also cannot * add a partial attribute which is of the same type as the class being queried. * <p><b>Example</b>: query.addPartialAttribute(query.getExpressionBuilder().get("address").get("city")) * @deprecated since EclipseLink 2.1, partial attributes replaced by fetch groups. * @see FetchGroup * Example: * FetchGroup fetchGroup = new FetchGroup(); * fetchGroup.addAttribute("address.city"); * query.setFetchGroup(fetchGroup); */ public void addPartialAttribute(Expression attributeExpression) { getPartialAttributeExpressions().add(attributeExpression); //Bug2804042 Must un-prepare if prepared as the SQL may change. setIsPrepared(false); }
/** * PUBLIC: * Specify that only a subset of the class' attributes be selected in this query. * <p>This allows for the query to be optimized through selecting less data. * <p>Partial objects will be returned from the query, where the unspecified attributes will be left <code>null</code>. * The primary key will always be selected to allow re-querying of the whole object. * <p>Note: Because the object is not fully initialized it cannot be cached, and cannot be edited. * <p>Note: You cannot have 2 partial attributes of the same type. You also cannot * add a partial attribute which is of the same type as the class being queried. * <p><b>Example</b>: query.addPartialAttribute(query.getExpressionBuilder().get("address").get("city")) * @deprecated since EclipseLink 2.1, partial attributes replaced by fetch groups. * @see FetchGroup * Example: * FetchGroup fetchGroup = new FetchGroup(); * fetchGroup.addAttribute("address.city"); * query.setFetchGroup(fetchGroup); */ public void addPartialAttribute(Expression attributeExpression) { getPartialAttributeExpressions().add(attributeExpression); //Bug2804042 Must un-prepare if prepared as the SQL may change. setIsPrepared(false); }
/** * INTERNAL: * Return if partial attribute. */ public boolean isPartialAttribute(String attributeName) { if (this.partialAttributeExpressions == null) { return false; } List<Expression> partialAttributeExpressions = getPartialAttributeExpressions(); int size = partialAttributeExpressions.size(); for (int index = 0; index < size; index++) { QueryKeyExpression expression = (QueryKeyExpression)partialAttributeExpressions.get(index); while (!expression.getBaseExpression().isExpressionBuilder()) { expression = (QueryKeyExpression)expression.getBaseExpression(); } if (expression.getName().equals(attributeName)) { return true; } } return false; }
/** * INTERNAL: * Return if partial attribute. */ public boolean isPartialAttribute(String attributeName) { if (this.partialAttributeExpressions == null) { return false; } List<Expression> partialAttributeExpressions = getPartialAttributeExpressions(); int size = partialAttributeExpressions.size(); for (int index = 0; index < size; index++) { QueryKeyExpression expression = (QueryKeyExpression)partialAttributeExpressions.get(index); while (!expression.getBaseExpression().isExpressionBuilder()) { expression = (QueryKeyExpression)expression.getBaseExpression(); } if (expression.getName().equals(attributeName)) { return true; } } return false; }
/** * INTERNAL: * Return if partial attribute. */ public boolean isPartialAttribute(String attributeName) { if (!hasPartialAttributeExpressions()) { return false; } List<Expression> partialAttributeExpressions = getPartialAttributeExpressions(); int size = partialAttributeExpressions.size(); for (int index = 0; index < size; index++) { QueryKeyExpression expression = (QueryKeyExpression)partialAttributeExpressions.get(index); while (!expression.getBaseExpression().isExpressionBuilder()) { expression = (QueryKeyExpression)expression.getBaseExpression(); } if (expression.getName().equals(attributeName)) { return true; } } return false; }
Iterator partialAttributes = ((ObjectLevelReadQuery)getBaseQuery()).getPartialAttributeExpressions().iterator(); while(partialAttributes.hasNext()){ Expression expression = (Expression)partialAttributes.next();
Iterator partialAttributes = ((ObjectLevelReadQuery)getBaseQuery()).getPartialAttributeExpressions().iterator(); while(partialAttributes.hasNext()){ Expression expression = (Expression)partialAttributes.next();
Vector localFields = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(getPartialAttributeExpressions().size()); Vector foreignFields = null; for(Iterator it = getPartialAttributeExpressions().iterator();it.hasNext();){ Expression expression = (Expression)it.next(); if (expression.isQueryKeyExpression()) {
Iterator partialAttributes = ((ObjectLevelReadQuery)getBaseQuery()).getPartialAttributeExpressions().iterator(); while(partialAttributes.hasNext()){ Expression expression = (Expression)partialAttributes.next();
Vector localFields = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(getPartialAttributeExpressions().size()); Vector foreignFields = null; for(Iterator it = getPartialAttributeExpressions().iterator();it.hasNext();){ Expression expression = (Expression)it.next(); if (expression.isQueryKeyExpression()) {
Vector localFields = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(getPartialAttributeExpressions().size()); Vector foreignFields = null; for(Iterator it = getPartialAttributeExpressions().iterator();it.hasNext();){ Expression expression = (Expression)it.next(); if (expression.isQueryKeyExpression()) {
nestedQuery.setPartialAttributeExpressions(extractNestedExpressions(((ObjectLevelReadQuery)baseQuery).getPartialAttributeExpressions(), nestedQuery.getExpressionBuilder(), false)); if(nestedQuery.getPartialAttributeExpressions().isEmpty()) { if(hasRootExpressionThatShouldUseOuterJoin(((ObjectLevelReadQuery)baseQuery).getPartialAttributeExpressions())) { nestedQuery.setShouldBuildNullForNullPk(true);
for (int index = 0; index < getPartialAttributeExpressions().size(); index++) { Expression expression = getPartialAttributeExpressions().get(index);
for (int index = 0; index < getPartialAttributeExpressions().size(); index++) { Expression expression = getPartialAttributeExpressions().get(index);
nestedQuery.setPartialAttributeExpressions(extractNestedExpressions(((ObjectLevelReadQuery)baseQuery).getPartialAttributeExpressions(), nestedQuery.getExpressionBuilder())); if(nestedQuery.getPartialAttributeExpressions().isEmpty()) { if(hasRootExpressionThatShouldUseOuterJoin(((ObjectLevelReadQuery)baseQuery).getPartialAttributeExpressions())) { nestedQuery.setShouldBuildNullForNullPk(true);
for (int index = 0; index < getPartialAttributeExpressions().size(); index++) { Expression expression = getPartialAttributeExpressions().get(index);
nestedObjectQuery.setPartialAttributeExpressions(extractNestedExpressions(objectQuery.getPartialAttributeExpressions(), nestedObjectQuery.getExpressionBuilder()));
nestedObjectQuery.setPartialAttributeExpressions(extractNestedExpressions(objectQuery.getPartialAttributeExpressions(), nestedObjectQuery.getExpressionBuilder()));
((ObjectLevelReadQuery)nestedQuery).setPartialAttributeExpressions(extractNestedExpressions(((ObjectLevelReadQuery)sourceQuery).getPartialAttributeExpressions(), ((ObjectLevelReadQuery)nestedQuery).getExpressionBuilder(), false)); } else { ((ObjectLevelReadQuery)nestedQuery).getJoinedAttributeManager().setJoinedAttributeExpressions_(extractNestedExpressions(joinManager.getJoinedAttributeExpressions(), joinManager.getBaseExpressionBuilder(), false));