@Override public QueryKey getQueryKeyOrNull() { if (!hasQueryKey) { return null; } // Oct 19, 2000 JED // Added try/catch. This was throwing a NPE in the following case // expresssionBuilder.get("firstName").get("bob") //moved by Gordon Yorke to cover validate and normalize if (getContainingDescriptor() == null) { throw QueryException.invalidQueryKeyInExpression(getName()); } if (queryKey == null) { queryKey = getContainingDescriptor().getQueryKeyNamed(getName()); if (queryKey == null) { hasQueryKey = false; } } return queryKey; }
public QueryKey getQueryKeyOrNull() { if (!hasQueryKey) { return null; } // Oct 19, 2000 JED // Added try/catch. This was throwing a NPE in the following case // expresssionBuilder.get("firstName").get("bob") //moved by Gordon Yorke to cover validate and normalize if (getContainingDescriptor() == null) { throw QueryException.invalidQueryKeyInExpression(getName()); } if (queryKey == null) { queryKey = getContainingDescriptor().getQueryKeyNamed(getName()); if (queryKey == null) { hasQueryKey = false; } } return queryKey; }
@Override public QueryKey getQueryKeyOrNull() { if (!hasQueryKey) { return null; } // Oct 19, 2000 JED // Added try/catch. This was throwing a NPE in the following case // expresssionBuilder.get("firstName").get("bob") //moved by Gordon Yorke to cover validate and normalize if (getContainingDescriptor() == null) { throw QueryException.invalidQueryKeyInExpression(getName()); } if (queryKey == null) { queryKey = getContainingDescriptor().getQueryKeyNamed(getName()); if (queryKey == null) { hasQueryKey = false; } } return queryKey; }
/** * INTERNAL: */ public DatabaseField getField() { if (!isAttribute()) { return null; } return getContainingDescriptor().getObjectBuilder().getFieldForQueryKeyName(getName()); }
/** * INTERNAL: * If the alias is for a query key item, then return its descriptor. * If it is for a function, then it has no descriptor. */ @Override public ClassDescriptor getContainingDescriptor() { AbstractSession session = getBuilder().getSession(); if (this.containingDescriptor == null) { Expression expression = getItem().getAttributeExpression(); if (expression.isQueryKeyExpression()) { // Need to ensure expression has a session before getting its descriptor. if (expression.getBuilder().getSession() == null) { expression.getBuilder().setSession(session); } this.containingDescriptor = ((QueryKeyExpression)expression).getContainingDescriptor(); return this.containingDescriptor; } return null; } return containingDescriptor; }
/** * INTERNAL: * If the alias is for a query key item, then return its descriptor. * If it is for a function, then it has no descriptor. */ @Override public ClassDescriptor getContainingDescriptor() { AbstractSession session = getBuilder().getSession(); if (this.containingDescriptor == null) { Expression expression = getItem().getAttributeExpression(); if (expression.isQueryKeyExpression()) { // Need to ensure expression has a session before getting its descriptor. if (expression.getBuilder().getSession() == null) { expression.getBuilder().setSession(session); } this.containingDescriptor = ((QueryKeyExpression)expression).getContainingDescriptor(); return this.containingDescriptor; } return null; } return containingDescriptor; }