public HibernateTraversableResolver( EntityPersister persister, ConcurrentHashMap<EntityPersister, Set<String>> associationsPerEntityPersister, SessionFactoryImplementor factory) { this.associations = associationsPerEntityPersister.get( persister ); if (this.associations == null) { this.associations = new HashSet<String>(); addAssociationsToTheSetForAllProperties( persister.getPropertyNames(), persister.getPropertyTypes(), "", factory ); associationsPerEntityPersister.put( persister, associations ); } }
private void addAssociationsToTheSetForOneProperty(String name, Type type, String prefix, SessionFactoryImplementor factory) { if ( type.isCollectionType() ) { CollectionType collType = (CollectionType) type; Type assocType = collType.getElementType( factory ); addAssociationsToTheSetForOneProperty(name, assocType, prefix, factory); } //ToOne association else if ( type.isEntityType() || type.isAnyType() ) { associations.add( prefix + name ); } else if ( type.isComponentType() ) { CompositeType componentType = (CompositeType) type; addAssociationsToTheSetForAllProperties( componentType.getPropertyNames(), componentType.getSubtypes(), (prefix.equals( "" ) ? name : prefix + name) + ".", factory); } }
public HibernateTraversableResolver( EntityPersister persister, ConcurrentHashMap<EntityPersister, Set<String>> associationsPerEntityPersister, SessionFactoryImplementor factory) { this.associations = associationsPerEntityPersister.get( persister ); if (this.associations == null) { this.associations = new HashSet<String>(); addAssociationsToTheSetForAllProperties( persister.getPropertyNames(), persister.getPropertyTypes(), "", factory ); associationsPerEntityPersister.put( persister, associations ); } }
private void addAssociationsToTheSetForOneProperty(String name, Type type, String prefix, SessionFactoryImplementor factory) { if ( type.isCollectionType() ) { CollectionType collType = (CollectionType) type; Type assocType = collType.getElementType( factory ); addAssociationsToTheSetForOneProperty(name, assocType, prefix, factory); } //ToOne association else if ( type.isEntityType() || type.isAnyType() ) { associations.add( prefix + name ); } else if ( type.isComponentType() ) { AbstractComponentType componentType = (AbstractComponentType) type; addAssociationsToTheSetForAllProperties( componentType.getPropertyNames(), componentType.getSubtypes(), (prefix.equals( "" ) ? name : prefix + name) + ".", factory); } }
public HibernateTraversableResolver( EntityTypeDescriptor entityDescriptor, ConcurrentHashMap<EntityTypeDescriptor, Set<String>> associationsPerEntityDescriptor) { this.associations = associationsPerEntityDescriptor.get( entityDescriptor ); if (this.associations == null) { this.associations = new HashSet<>(); addAssociationsToTheSetForAllProperties( entityDescriptor ); associationsPerEntityDescriptor.put( entityDescriptor, associations ); } }
public HibernateTraversableResolver( EntityPersister persister, ConcurrentHashMap<EntityPersister, Set<String>> associationsPerEntityPersister, SessionFactoryImplementor factory) { this.associations = associationsPerEntityPersister.get( persister ); if (this.associations == null) { this.associations = new HashSet<String>(); addAssociationsToTheSetForAllProperties( persister.getPropertyNames(), persister.getPropertyTypes(), "", factory ); associationsPerEntityPersister.put( persister, associations ); } }
public HibernateTraversableResolver( EntityPersister persister, ConcurrentHashMap<EntityPersister, Set<String>> associationsPerEntityPersister, SessionFactoryImplementor factory) { this.associations = associationsPerEntityPersister.get( persister ); if (this.associations == null) { this.associations = new HashSet<String>(); addAssociationsToTheSetForAllProperties( persister.getPropertyNames(), persister.getPropertyTypes(), "", factory ); associationsPerEntityPersister.put( persister, associations ); } }
private void addAssociationsToTheSetForOneProperty(PersistentAttributeDescriptor attribute) { if ( attribute instanceof PluralPersistentAttribute || attribute instanceof SingularPersistentAttributeEntity ) { associations.add( attribute.getNavigableRole().getFullPath() ); } else if ( attribute instanceof SingularPersistentAttributeEmbedded ) { addAssociationsToTheSetForAllProperties( ( (SingularPersistentAttributeEmbedded) attribute ).getEmbeddedDescriptor() ); } }
private void addAssociationsToTheSetForOneProperty(String name, Type type, String prefix, SessionFactoryImplementor factory) { if ( type.isCollectionType() ) { CollectionType collType = (CollectionType) type; Type assocType = collType.getElementType( factory ); addAssociationsToTheSetForOneProperty(name, assocType, prefix, factory); } //ToOne association else if ( type.isEntityType() || type.isAnyType() ) { associations.add( prefix + name ); } else if ( type.isComponentType() ) { CompositeType componentType = (CompositeType) type; addAssociationsToTheSetForAllProperties( componentType.getPropertyNames(), componentType.getSubtypes(), (prefix.equals( "" ) ? name : prefix + name) + ".", factory); } }
private void addAssociationsToTheSetForOneProperty(String name, Type type, String prefix, SessionFactoryImplementor factory) { if ( type.isCollectionType() ) { CollectionType collType = (CollectionType) type; Type assocType = collType.getElementType( factory ); addAssociationsToTheSetForOneProperty(name, assocType, prefix, factory); } //ToOne association else if ( type.isEntityType() || type.isAnyType() ) { associations.add( prefix + name ); } else if ( type.isComponentType() ) { CompositeType componentType = (CompositeType) type; addAssociationsToTheSetForAllProperties( componentType.getPropertyNames(), componentType.getSubtypes(), (prefix.equals( "" ) ? name : prefix + name) + ".", factory); } }