/** * INTERNAL: */ @Override public List<DatabaseField> getSelectionFields(ReadQuery query) { if (isAttribute()) { List<DatabaseField> result = new ArrayList<DatabaseField>(1); DatabaseField field = getField(); if (field != null) { result.add(field); } return result; } else { List<DatabaseField> result = new ArrayList<DatabaseField>(); result.addAll(super.getSelectionFields(query)); if ((this.mapping != null) && this.mapping.isCollectionMapping()){ List<DatabaseField> fields = this.mapping.getContainerPolicy().getAdditionalFieldsForJoin((CollectionMapping)this.mapping); if (fields != null){ result.addAll(fields); } } return result; } }
/** * INTERNAL: * Return all the fields */ public Vector getFields() { if (isAttribute()) { Vector result = new Vector(1); DatabaseField field = getField(); if (field != null) { result.addElement(field); } return result; } else { Vector result = new Vector(); result.addAll(super.getFields()); if (mapping.isCollectionMapping()){ List<DatabaseField> fields = mapping.getContainerPolicy().getAllFieldsForMapKey((CollectionMapping)mapping); if (fields != null){ result.addAll(fields); } } return result; } }
/** * INTERNAL: */ @Override public List<DatabaseField> getSelectionFields(ReadQuery query) { if (isAttribute()) { List<DatabaseField> result = new ArrayList<DatabaseField>(1); DatabaseField field = getField(); if (field != null) { result.add(field); } return result; } else { List<DatabaseField> result = new ArrayList<DatabaseField>(); result.addAll(super.getSelectionFields(query)); if ((this.mapping != null) && this.mapping.isCollectionMapping()){ List<DatabaseField> fields = this.mapping.getContainerPolicy().getAdditionalFieldsForJoin((CollectionMapping)this.mapping); if (fields != null){ result.addAll(fields); } } return result; } }
/** * INTERNAL: * Return all the fields */ @Override public Vector getFields() { if (isAttribute()) { Vector result = new Vector(1); DatabaseField field = getField(); if (field != null) { result.addElement(field); } return result; } else { Vector result = new Vector(); result.addAll(super.getFields()); if ((this.mapping != null) && this.mapping.isCollectionMapping()){ List<DatabaseField> fields = this.mapping.getContainerPolicy().getAdditionalFieldsForJoin((CollectionMapping)this.mapping); if (fields != null){ result.addAll(fields); } } return result; } }
/** * INTERNAL: * Alias the database field for our current environment */ protected void initializeAliasedField() { DatabaseField tempField = getField().clone(); DatabaseTable aliasedTable = getAliasedTable(); // Put in a special check here so that if the aliasing does nothing we don't cache the // result because it's invalid. This saves us from caching premature data if e.g. debugging // causes us to print too early" // if (aliasedTable.equals(getField().getTable())) { // return; // } else { aliasedField = tempField; aliasedField.setTable(aliasedTable); // } }
/** * INTERNAL: * Return all the fields */ @Override public Vector getFields() { if (isAttribute()) { Vector result = new Vector(1); DatabaseField field = getField(); if (field != null) { result.addElement(field); } return result; } else { Vector result = new Vector(); result.addAll(super.getFields()); if ((this.mapping != null) && this.mapping.isCollectionMapping()){ List<DatabaseField> fields = this.mapping.getContainerPolicy().getAdditionalFieldsForJoin((CollectionMapping)this.mapping); if (fields != null){ result.addAll(fields); } } return result; } }
/** * INTERNAL: * Alias the database field for our current environment */ protected void initializeAliasedField() { DatabaseField tempField = getField().clone(); DatabaseTable aliasedTable = getAliasedTable(); // Put in a special check here so that if the aliasing does nothing we don't cache the // result because it's invalid. This saves us from caching premature data if e.g. debugging // causes us to print too early" // if (aliasedTable.equals(getField().getTable())) { // return; // } else { aliasedField = tempField; aliasedField.setTable(aliasedTable); // } }
/** * INTERNAL: * Alias the database field for our current environment */ protected void initializeAliasedField() { DatabaseField tempField = (DatabaseField)getField().clone(); DatabaseTable aliasedTable = getAliasedTable(); // Put in a special check here so that if the aliasing does nothing we don't cache the // result because it's invalid. This saves us from caching premature data if e.g. debugging // causes us to print too early" // if (aliasedTable.equals(getField().getTable())) { // return; // } else { aliasedField = tempField; aliasedField.setTable(aliasedTable); // } }
public void printNull(ConstantExpression nullValueExpression) { if(session.getPlatform().shouldBindLiterals()) { DatabaseField field = null; Expression localBase = nullValueExpression.getLocalBase(); if(localBase.isFieldExpression()) { field = ((FieldExpression)localBase).getField(); } else if(localBase.isQueryKeyExpression()) { field = ((QueryKeyExpression)localBase).getField(); } session.getPlatform().appendLiteralToCall(getCall(), getWriter(), field); } else { session.getPlatform().appendLiteralToCall(getCall(), getWriter(), null); } }
public void printNull(ConstantExpression nullValueExpression) { if(session.getPlatform().shouldBindLiterals()) { DatabaseField field = null; Expression localBase = nullValueExpression.getLocalBase(); if(localBase.isFieldExpression()) { field = ((FieldExpression)localBase).getField(); } else if(localBase.isQueryKeyExpression()) { field = ((QueryKeyExpression)localBase).getField(); } session.getPlatform().appendLiteralToCall(getCall(), getWriter(), field); } else { session.getPlatform().appendLiteralToCall(getCall(), getWriter(), null); } }
if (expression.isQueryKeyExpression()) { QueryKeyExpression queryKeyExpression = (QueryKeyExpression)expression; value = queryKeyExpression.getField(); if ((queryKeyExpression.getMapping() != null) && queryKeyExpression.getMapping().getDescriptor().isDescriptorTypeAggregate()) { String name = queryKeyExpression.getField().getName(); while (queryKeyExpression.getBaseExpression().isQueryKeyExpression() && (((QueryKeyExpression)queryKeyExpression.getBaseExpression()).getMapping().isAbstractCompositeObjectMapping()
&& ((OneToOneMapping)mapping).isForeignKeyRelationship() && (second.isConstantExpression() || second.isParameterExpression())) { DatabaseField targetField = ((QueryKeyExpression)first).getField(); DatabaseField sourceField = ((OneToOneMapping)mapping).getTargetToSourceKeyFields().get(targetField); if (sourceField != null) {
&& ((OneToOneMapping)mapping).isForeignKeyRelationship() && (second.isConstantExpression() || second.isParameterExpression())) { DatabaseField targetField = ((QueryKeyExpression)first).getField(); DatabaseField sourceField = ((OneToOneMapping)mapping).getTargetToSourceKeyFields().get(targetField); if (sourceField != null) {