Examples of AssociationType


Examples of com.arconsis.android.datarobot.schema.AssociationType

    }

    int lastDot = canonicalType.lastIndexOf(".");
    String simpleType = canonicalType.substring(lastDot + 1, canonicalType.length());

    AssociationType cardinality = (isCollectionType) ? AssociationType.TO_MANY : AssociationType.TO_ONE;
    return new Association(nameInEntity, canonicalType, simpleType, cardinality);
  }
View Full Code Here

Examples of org.hibernate.metamodel.source.annotations.entity.AssociationType

    final Map<DotName, List<AnnotationInstance>> annotations = JandexHelper.getMemberAnnotations(
        classInfo, member.getName()
    );

    MappedAttribute attribute;
    AssociationType associationType = determineAssociationType( annotations );
    switch ( associationType ) {
      case NO_ASSOCIATION: {
        attribute = SimpleAttribute.createSimpleAttribute( name, ( (Class) type ).getName(), annotations );
        break;
      }
View Full Code Here

Examples of org.hibernate.type.AssociationType

    if ( subgraphMap == null ) {
      subgraphMap = new HashMap<Class, Subgraph>();
    }

    final AssociationType attributeType = (AssociationType) Helper.resolveType( sessionFactory(), attribute );
    final Joinable joinable = attributeType.getAssociatedJoinable( sessionFactory() );

    if ( joinable.isCollection() ) {
      final EntityPersister elementEntityPersister = ( (QueryableCollection) joinable ).getElementPersister();
      if ( type == null ) {
        type = elementEntityPersister.getMappedClass();
View Full Code Here

Examples of org.hibernate.type.AssociationType

      throw new IllegalArgumentException(
          String.format( "Non-Map attribute [%s] cannot be target of key subgraph", getAttributeName() )
      );
    }

    final AssociationType attributeType = (AssociationType) Helper.resolveType( sessionFactory(), attribute );
    final QueryableCollection collectionPersister = (QueryableCollection) attributeType.getAssociatedJoinable( sessionFactory() );
    final Type indexType = collectionPersister.getIndexType();

    if ( ! indexType.isAssociationType() ) {
      throw new IllegalArgumentException(
          String.format( "Map index [%s] is not an entity; cannot be target of key subgraph", getAttributeName() )
      );
    }

    if ( keySubgraphMap == null ) {
      keySubgraphMap = new HashMap<Class, Subgraph>();
    }

    final AssociationType indexAssociationType = (AssociationType) indexType;
    final EntityPersister indexEntityPersister = (EntityPersister) indexAssociationType.getAssociatedJoinable( sessionFactory() );

    if ( type == null ) {
      type = indexEntityPersister.getMappedClass();
    }
    else {
View Full Code Here

Examples of org.hibernate.type.AssociationType

    String componentPath = "";
    while ( tokens.hasMoreTokens() ) {
      componentPath += tokens.nextToken();
      Type type = persister.toType( componentPath );
      if ( type.isAssociationType() ) {
        AssociationType atype = ( AssociationType ) type;
        persister = ( Queryable ) sessionFactory.getEntityPersister(
            atype.getAssociatedEntityName( sessionFactory )
        );
        componentPath = "";
      }
      else if ( type.isComponentType() ) {
        componentPath += '.';
View Full Code Here

Examples of org.hibernate.type.AssociationType

      final Object anything,
      final boolean isCascadeDeleteEnabled) throws HibernateException {

    if (child!=null) {
      if ( type.isAssociationType() ) {
        AssociationType associationType = (AssociationType) type;
        if ( cascadeAssociationNow( associationType ) ) {
          cascadeAssociation(
              child,
              type,
              style,
View Full Code Here

Examples of org.hibernate.type.AssociationType

          String collectionSuffix,
          boolean includeCollectionColumns) {
    // we need to determine the best way to know that two joinables
    // represent a single many-to-many...
    if ( rhs != null && isManyToMany() && !rhs.isCollection() ) {
      AssociationType elementType = ( ( AssociationType ) getElementType() );
      if ( rhs.equals( elementType.getAssociatedJoinable( getFactory() ) ) ) {
        return manyToManySelectFragment( rhs, rhsAlias, lhsAlias, collectionSuffix );
      }
    }
    return includeCollectionColumns ? selectFragment( lhsAlias, collectionSuffix ) : "";
  }
View Full Code Here

Examples of org.hibernate.type.AssociationType

    CollectionType type = queryableCollection.getCollectionType();
    String role = type.getRole();
    String roleAlias = origin.getTableAlias();

    String[] targetColumns = sfh.getCollectionElementColumns( role, roleAlias );
    AssociationType elementAssociationType = sfh.getElementAssociationType( type );

    // Create the join element under the from element.
    int joinType = JoinFragment.INNER_JOIN;
    JoinSequence joinSequence = sfh.createJoinSequence( implied, elementAssociationType, tableAlias, joinType, targetColumns );
    elem = initializeJoin( path, destination, joinSequence, targetColumns, origin, false );
View Full Code Here

Examples of org.hibernate.type.AssociationType

          " of: " + getEntityName()
        );
    }

    if ( type.isAssociationType() ) {
      AssociationType actype = (AssociationType) type;
      if ( actype.useLHSPrimaryKey() ) {
        columns = getIdentifierColumnNames();
      }
      else {
        String foreignKeyProperty = actype.getLHSPropertyName();
        if ( foreignKeyProperty!=null && !path.equals(foreignKeyProperty) ) {
          //TODO: this requires that the collection is defined after the
          //      referenced property in the mapping file (ok?)
          columns = (String[]) columnsByPropertyPath.get(foreignKeyProperty);
          if (columns==null) return; //get em on the second pass!
        }
      }
    }

    if (path!=null) addPropertyPath(path, type, columns, formulaTemplates);

    if ( type.isComponentType() ) {
      AbstractComponentType actype = (AbstractComponentType) type;
      initComponentPropertyPaths( path, actype, columns, formulaTemplates, factory );
      if ( actype.isEmbedded() ) {
        initComponentPropertyPaths(
            path==null ? null : StringHelper.qualifier(path),
            actype,
            columns,
            formulaTemplates,
View Full Code Here

Examples of org.hibernate.type.AssociationType

   */
  public int getSubclassPropertyTableNumber(String propertyPath) {
    String rootPropertyName = StringHelper.root(propertyPath);
    Type type = propertyMapping.toType(rootPropertyName);
    if ( type.isAssociationType() ) {
      AssociationType assocType = ( AssociationType ) type;
      if ( assocType.useLHSPrimaryKey() ) {
        // performance op to avoid the array search
        return 0;
      }
      else if ( type.isCollectionType() ) {
        // properly handle property-ref-based associations
        rootPropertyName = assocType.getLHSPropertyName();
      }
    }
    //Enable for HHH-440, which we don't like:
    /*if ( type.isComponentType() && !propertyName.equals(rootPropertyName) ) {
      String unrooted = StringHelper.unroot(propertyName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.