Package org.hibernate.type

Examples of org.hibernate.type.AssociationType


      final int currentDepth) throws MappingException {
    Type[] types = componentType.getSubtypes();
    String[] propertyNames = componentType.getPropertyNames();
    for ( int i = 0; i < types.length; i++ ) {
      if ( types[i].isAssociationType() ) {
        AssociationType associationType = (AssociationType) types[i];
        String[] aliasedLhsColumns = JoinHelper.getAliasedLHSColumnNames(
          associationType, alias, propertyNumber, begin, persister, getFactory()
        );
        String[] lhsColumns = JoinHelper.getLHSColumnNames(
          associationType, propertyNumber, begin, persister, getFactory()
View Full Code Here


    for ( int i=0; i <types.length; i++ ) {
      int length = types[i].getColumnSpan( getFactory() );
      String[] lhsColumns = ArrayHelper.slice(cols, begin, length);

      if ( types[i].isAssociationType() ) {
        AssociationType associationType = (AssociationType) types[i];

        // simple, because we can't have a one-to-one or a collection
        // (or even a property-ref) in a composite-element:
        String[] aliasedLhsColumns = StringHelper.qualify(alias, lhsColumns);
View Full Code Here

    while ( tokens.hasMoreTokens() ) {
      componentPath += tokens.nextToken();
      Type type = provider.getType( componentPath );
      if ( type.isAssociationType() ) {
        // CollectionTypes are always also AssociationTypes - but there's not always an associated entity...
        AssociationType atype = ( AssociationType ) type;
        CollectionType ctype = type.isCollectionType() ? (CollectionType)type : null;
        Type elementType = (ctype != null) ? ctype.getElementType( sessionFactory ) : null;
        // is the association a collection of components or value-types? (i.e a colloction of valued types?)
        if ( ctype != null  && elementType.isComponentType() ) {
          provider = new ComponentCollectionCriteriaInfoProvider( helper.getCollectionPersister(ctype.getRole()) );
        }
        else if ( ctype != null && !elementType.isEntityType() ) {
          provider = new ScalarCollectionCriteriaInfoProvider( helper, ctype.getRole() );
        }
        else {
          provider = new EntityCriteriaInfoProvider(( Queryable ) sessionFactory.getEntityPersister(
                        atype.getAssociatedEntityName( sessionFactory )
                        ));
        }
       
        componentPath = "";
      }
View Full Code Here

      final Object anything,
      final boolean isCascadeDeleteEnabled) throws HibernateException {

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

    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.
    JoinType joinType = JoinType.INNER_JOIN;
    JoinSequence joinSequence = sfh.createJoinSequence( implied, elementAssociationType, tableAlias, joinType, targetColumns );
    elem = initializeJoin( path, destination, joinSequence, targetColumns, origin, false );
View Full Code Here

      Type type = persister.getElementType();
      if ( type.isAssociationType() ) {
        // a many-to-many;
        // decrement currentDepth here to allow join across the association table
        // without exceeding MAX_FETCH_DEPTH (i.e. the "currentDepth - 1" bit)
        AssociationType associationType = (AssociationType) type;
        String[] aliasedLhsColumns = persister.getElementColumnNames(alias);
        String[] lhsColumns = persister.getElementColumnNames();
        // if the current depth is 0, the root thing being loaded is the
        // many-to-many collection itself.  Here, it is alright to use
        // an inner join...
View Full Code Here

      final int currentDepth) throws MappingException {
    Type[] types = componentType.getSubtypes();
    String[] propertyNames = componentType.getPropertyNames();
    for ( int i = 0; i < types.length; i++ ) {
      if ( types[i].isAssociationType() ) {
        AssociationType associationType = (AssociationType) types[i];
        String[] aliasedLhsColumns = JoinHelper.getAliasedLHSColumnNames(
          associationType, alias, propertyNumber, begin, persister, getFactory()
        );
        String[] lhsColumns = JoinHelper.getLHSColumnNames(
          associationType, propertyNumber, begin, persister, getFactory()
View Full Code Here

    for ( int i=0; i <types.length; i++ ) {
      int length = types[i].getColumnSpan( getFactory() );
      String[] lhsColumns = ArrayHelper.slice(cols, begin, length);

      if ( types[i].isAssociationType() ) {
        AssociationType associationType = (AssociationType) types[i];

        // simple, because we can't have a one-to-one or a collection
        // (or even a property-ref) in a composite-element:
        String[] aliasedLhsColumns = StringHelper.qualify(alias, lhsColumns);
View Full Code Here

   */
  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

      final Object anything,
      final boolean isCascadeDeleteEnabled) throws HibernateException {

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

TOP

Related Classes of org.hibernate.type.AssociationType

Copyright © 2018 www.massapicom. 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.