private String extractFullPath(PropertyPath path) { return path == null ? "<no-path>" : path.getFullPath(); }
@Override protected boolean hasRestriction(PropertyPath path) { return translator.hasRestriction( path.getFullPath() ); } }
@Override protected String getWithClause(PropertyPath path) { return translator.getWithClause( path.getFullPath() ); }
public PropertyPath(PropertyPath parent, String property) { this.parent = parent; this.property = property; // the _identifierMapper is a "hidden" property on entities with composite keys. // concatenating it will prevent the path from correctly being used to look up // various things such as criteria paths and fetch profile association paths if ( IDENTIFIER_MAPPER_PROPERTY.equals( property ) ) { this.fullPath = parent != null ? parent.getFullPath() : ""; } else { final String prefix; if ( parent != null ) { final String resolvedParent = parent.getFullPath(); if ( StringHelper.isEmpty( resolvedParent ) ) { prefix = ""; } else { prefix = resolvedParent + '.'; } } else { prefix = ""; } this.fullPath = prefix + property; } }
private String extractDetails(CompositeFetch compositeFetch) { return String.format( "%s(composite=%s, querySpaceUid=%s, path=%s)", compositeFetch.getClass().getSimpleName(), compositeFetch.getFetchedType().getReturnedClass().getName(), compositeFetch.getQuerySpaceUid(), compositeFetch.getPropertyPath().getFullPath() ); }
private String extractDetails(EntityReference entityReference) { return String.format( "%s(entity=%s, querySpaceUid=%s, path=%s)", entityReference.getClass().getSimpleName(), entityReference.getEntityPersister().getEntityName(), entityReference.getQuerySpaceUid(), entityReference.getPropertyPath().getFullPath() ); }
private String extractDetails(CollectionReference collectionReference) { // todo : include some form of parameterized type signature? i.e., List<String>, Set<Person>, etc return String.format( "%s(collection=%s, querySpaceUid=%s, path=%s)", collectionReference.getClass().getSimpleName(), collectionReference.getCollectionPersister().getRole(), collectionReference.getQuerySpaceUid(), collectionReference.getPropertyPath().getFullPath() ); }
@Override public CollectionAttributeFetch buildCollectionAttributeFetch( AssociationAttributeDefinition attributeDefinition, FetchStrategy fetchStrategy) { if ( !allowCollectionFetches ) { throw new WalkingException( String.format( "This composite path [%s] does not allow collection fetches (composite id or composite collection index/element", getPropertyPath().getFullPath() ) ); } return super.buildCollectionAttributeFetch( attributeDefinition, fetchStrategy ); } }
public EntityReferenceProcessingState getIdentifierResolutionContext(ResultSetProcessingContext context) { final EntityReferenceProcessingState entityReferenceProcessingState = context.getProcessingState( entityReturn ); if ( entityReferenceProcessingState == null ) { throw new AssertionFailure( String.format( "Could not locate EntityReferenceProcessingState for root entity return [%s (%s)]", entityReturn.getPropertyPath().getFullPath(), entityReturn.getEntityPersister().getEntityName() ) ); } return entityReferenceProcessingState; }
protected final boolean isJoinFetchEnabledByProfile(OuterJoinLoadable persister, PropertyPath path, int propertyNumber) { if ( !getLoadQueryInfluencers().hasEnabledFetchProfiles() ) { // perf optimization return false; } // ugh, this stuff has to be made easier... final String fullPath = path.getFullPath(); String rootPropertyName = persister.getSubclassPropertyName( propertyNumber ); int pos = fullPath.lastIndexOf( rootPropertyName ); String relativePropertyPath = pos >= 0 ? fullPath.substring( pos ) : rootPropertyName; String fetchRole = persister.getEntityName() + "." + relativePropertyPath; for ( String profileName : getLoadQueryInfluencers().getEnabledFetchProfileNames() ) { final FetchProfile profile = getFactory().getFetchProfile( profileName ); final Fetch fetch = profile.getFetchByRole( fetchRole ); if ( fetch != null && Fetch.Style.JOIN == fetch.getStyle() ) { return true; } } return false; }
final String fullPath = path.getFullPath(); final String rootPropertyName = ( (OuterJoinLoadable) persister ).getSubclassPropertyName( propertyNumber ); int pos = fullPath.lastIndexOf( rootPropertyName );
private void visitAttributeDefinition(AttributeDefinition attributeDefinition, AbstractEntityPersister sourcePersister) { final PropertyPath subPath = currentPropertyPath.append( attributeDefinition.getName() ); log.debug( "Visiting attribute path : " + subPath.getFullPath() ); final AssociationKey associationKey = associationAttributeDefinition.getAssociationKey(); if ( isDuplicateAssociationKey( associationKey ) ) { log.debug( "Property path deemed to be circular : " + subPath.getFullPath() ); strategy.foundCircularAssociation( associationAttributeDefinition );
final Criteria subcriteria = translator.getCriteria( path.getFullPath() ); sqlAlias = subcriteria == null ? null : translator.getSQLAlias( subcriteria );
final int currentDepth) throws MappingException { final JoinType resolvedJoinType; if ( translator.isJoin( path.getFullPath() ) ) { resolvedJoinType = translator.getJoinType( path.getFullPath() ); String fullPathWithAlias = path.getFullPath(); String rootAlias = translator.getRootCriteria().getAlias(); String rootAliasPathPrefix = rootAlias + ".";
loadQueryInfluencers.getEnabledFilters() ); assoc.validateJoin( path.getFullPath() ); associations.add( assoc );
private void visitCollectionIndex(CollectionDefinition collectionDefinition) { final CollectionIndexDefinition collectionIndexDefinition = collectionDefinition.getIndexDefinition(); if ( collectionIndexDefinition == null ) { return; } strategy.startingCollectionIndex( collectionIndexDefinition ); try { log.debug( "Visiting index for collection : " + currentPropertyPath.getFullPath() ); currentPropertyPath = currentPropertyPath.append( "<index>" ); try { final Type collectionIndexType = collectionIndexDefinition.getType(); if ( collectionIndexType.isAnyType() ) { visitAnyDefinition( collectionIndexDefinition.toAnyMappingDefinition() ); } else if ( collectionIndexType.isComponentType() ) { visitCompositeDefinition( collectionIndexDefinition.toCompositeDefinition() ); } else if ( collectionIndexType.isAssociationType() ) { visitEntityDefinition( collectionIndexDefinition.toEntityDefinition() ); } } finally { currentPropertyPath = currentPropertyPath.getParent(); } } finally { strategy.finishingCollectionIndex( collectionIndexDefinition ); } }
protected boolean hasRestriction(PropertyPath path) { return translator.hasRestriction( path.getFullPath() ); } }
protected String getWithClause(PropertyPath path) { return translator.getWithClause( path.getFullPath() ); }
protected boolean hasRestriction(PropertyPath path) { return translator.hasRestriction( path.getFullPath() ); } }
protected String getWithClause(PropertyPath path) { return translator.getWithClause( path.getFullPath() ); }