/** * INTERNAL: */ public boolean isEmbeddable() { return m_descriptor.isAggregateDescriptor(); }
/** Returns true if the specified type denotes an entity class. */ public boolean isEntityClass(Object type) { ClassDescriptor desc = getDescriptor(type); return (desc != null) && !desc.isAggregateDescriptor(); }
/** Returns true if the specified type denotes an entity class. */ public boolean isEntityClass(Object type) { ClassDescriptor desc = getDescriptor(type); return (desc != null) && !desc.isAggregateDescriptor(); }
/** Returns true if the specified type denotes an embedded class. */ public boolean isEmbeddable(Object type) { ClassDescriptor desc = getDescriptor(type); return (desc != null) && desc.isAggregateDescriptor(); }
/** Returns true if the specified type denotes an embedded class. */ public boolean isEmbeddable(Object type) { ClassDescriptor desc = getDescriptor(type); return (desc != null) && desc.isAggregateDescriptor(); }
/** Returns true if the specified type denotes an embedded class. */ public boolean isEmbeddable(Object type) { ClassDescriptor desc = getDescriptor(type); return (desc != null) && desc.isAggregateDescriptor(); }
/** * {@inheritDoc} */ @Override public ClassDescriptor getEmbeddable(Object type) { ClassDescriptor descriptor = queryContext.getDescriptor((Class<?>) type); if ((descriptor != null) && descriptor.isAggregateDescriptor()) { return descriptor; } return null; }
/** * {@inheritDoc} */ @Override public ClassDescriptor getEmbeddable(Object type) { ClassDescriptor descriptor = queryContext.getDescriptor((Class<?>) type); if ((descriptor != null) && descriptor.isAggregateDescriptor()) { return descriptor; } return null; }
/** Returns true if the specified type denotes an entity class. */ public boolean isEntityClass(Object type) { ClassDescriptor desc = getDescriptor(type); return (desc != null) && !desc.isAggregateDescriptor(); }
/** * INTERNAL: * Aggregate and Interface descriptors do not require initialization as they are cloned and * initialized by each mapping. */ public boolean requiresInitialization() { return !(isAggregateDescriptor() || isDescriptorForInterface() || isAggregateCollectionDescriptor()); }
/** * INTERNAL: * This method is explicitly used by the XML reader. */ public String getDescriptorTypeValue() { if (isAggregateCollectionDescriptor()) { return "Aggregate collection"; } else if (isAggregateDescriptor()) { return "Aggregate"; } else if (isDescriptorForInterface()) { return "Interface"; } else { // Default. return "Normal"; } }
/** * Return if the attribute is specified for joining. */ public boolean isAttributeJoined(ClassDescriptor mappingDescriptor, String attributeName) { // 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 != getDescriptor())) { return false; } if (this.hasJoinedAttributes()) { return this.joinedAttributes.contains(attributeName); } return isAttributeExpressionJoined(attributeName) || isAttributeMappingJoined(attributeName); }
public <T> EntityGraph<T> createEntityGraph(Class<T> rootType) { ClassDescriptor descriptor = getAbstractSession().getDescriptor(rootType); if (descriptor == null || descriptor.isAggregateDescriptor()){ throw new IllegalArgumentException(ExceptionLocalization.buildMessage("unknown_bean_class", new Object[]{rootType.getName()})); } return new EntityGraphImpl<T>(new AttributeGroup(null, rootType, true), descriptor); }
public void recordPrivateOwnedRemovals(Object object, UnitOfWorkImpl uow, boolean initialPass) { if (!this.descriptor.isAggregateCollectionDescriptor() && !this.descriptor.isAggregateDescriptor()){ if (!initialPass && uow.getDeletedObjects().containsKey(object)){ return; } uow.getDeletedObjects().put(object, object); } if (this.descriptor.hasMappingsPostCalculateChanges()){ for (DatabaseMapping mapping : this.descriptor.getMappingsPostCalculateChanges()){ mapping.recordPrivateOwnedRemovals(object, uow); } } }
/** * INTERNAL: */ public DatabaseTable getPrimaryTable() { if (m_primaryTable == null && isInheritanceSubclass()) { return getInheritanceRootDescriptor().getPrimaryTable(); } else { if (m_descriptor.isAggregateDescriptor()) { // Aggregate descriptors don't have tables, just return a // a default empty table. return new DatabaseTable(); } return m_primaryTable; } }
/** * Verify that an aggregate descriptor's inheritance tree * is full of aggregate descriptors, cont. */ private void checkInheritanceTreeAggregateSettingsForChildren(AbstractSession session, AggregateMapping mapping) throws DescriptorException { if (!this.isAggregateDescriptor()) { session.getIntegrityChecker().handleError(DescriptorException.referenceDescriptorIsNotAggregate(this.getJavaClass().getName(), mapping)); } for (ClassDescriptor childDescriptor : this.getInheritancePolicy().getChildDescriptors()) { // recurse down the inheritance tree to its leaves childDescriptor.checkInheritanceTreeAggregateSettingsForChildren(session, mapping); } }
/** * Verify that an aggregate descriptor's inheritance tree * is full of aggregate descriptors, cont. */ private void checkInheritanceTreeAggregateSettingsForChildren(AbstractSession session, AggregateMapping mapping) throws DescriptorException { if (!this.isAggregateDescriptor()) { session.getIntegrityChecker().handleError(DescriptorException.referenceDescriptorIsNotAggregate(this.getJavaClass().getName(), mapping)); } for (ClassDescriptor childDescriptor : this.getInheritancePolicy().getChildDescriptors()) { // recurse down the inheritance tree to its leaves childDescriptor.checkInheritanceTreeAggregateSettingsForChildren(session, mapping); } }
/** * INTERNAL: * Prepare the receiver for execution in a session. * In particular check that the tables on the descriptor are set. */ protected void prepare() throws QueryException { checkDescriptor(this.session); if (this.object != null) {// Prepare can be called without the object set yet. this.object = this.descriptor.getObjectBuilder().unwrapObject(this.object, this.session); } if (this.descriptor.isAggregateDescriptor()) { throw QueryException.aggregateObjectCannotBeDeletedOrWritten(getDescriptor(), this); } super.prepare(); }
/** * INTERNAL: * Prepare the receiver for execution in a session. * In particular check that the tables on the descriptor are set. */ protected void prepare() throws QueryException { checkDescriptor(this.session); if (this.object != null) {// Prepare can be called without the object set yet. this.object = this.descriptor.getObjectBuilder().unwrapObject(this.object, this.session); } if (this.descriptor.isAggregateDescriptor()) { throw QueryException.aggregateObjectCannotBeDeletedOrWritten(getDescriptor(), this); } super.prepare(); }
/** * INTERNAL: * Prepare the receiver for execution in a session. * In particular check that the tables on the descriptor are set. */ protected void prepare() throws QueryException { checkDescriptor(getSession()); if (getObject() != null) {// Prepare can be called without the object set yet. setObject(getDescriptor().getObjectBuilder().unwrapObject(getObject(), getSession())); } if (getDescriptor().isAggregateDescriptor()) { throw QueryException.aggregateObjectCannotBeDeletedOrWritten(getDescriptor(), this); } super.prepare(); }