/** Return any tables that are defined by this expression (and not its base). */ @Override public List<DatabaseTable> getOwnedTables() { ClassDescriptor descriptor = getDescriptor(); List<DatabaseTable> tables = null; if (descriptor == null) { List additionalTables = getAdditionalTables(); if (additionalTables == null) { return null; } else { return new ArrayList(additionalTables); } } else if (descriptor.isAggregateDescriptor()) { return null; } else if ((descriptor.getHistoryPolicy() != null) && (getAsOfClause() != null && getAsOfClause().getValue() != null)) { tables = descriptor.getHistoryPolicy().getHistoricalTables(); } else if (isUsingOuterJoinForMultitableInheritance()) { tables = descriptor.getInheritancePolicy().getAllTables(); } else { tables = descriptor.getTables(); } List additionalTables = getAdditionalTables(); if (additionalTables != null) { tables = new Vector(tables); Helper.addAllUniqueToList(tables, additionalTables); return tables; } return tables; }
/** INTERNAL: Return if the attribute is specified for batch reading. */ public boolean isAttributeBatchRead(ClassDescriptor mappingDescriptor, String attributeName) { if (!hasBatchReadAttributes()) { return false; } // Since aggregates share the same query as their parent, must avoid the aggregate thinking // the parents mappings is for it, (queries only share if the aggregate was not joined). if (mappingDescriptor.isAggregateDescriptor() && (mappingDescriptor != this.descriptor)) { return false; } if (this.batchReadAttributes != null) { return this.batchReadAttributes.contains(attributeName); } return isAttributeBatchRead(attributeName); }