Package org.hibernate.type

Examples of org.hibernate.type.EntityType


      String role = ownerPersister.getEntityName() + '.' + fetchReturn.getOwnerProperty();
      addCollection( role, alias, fetchReturn.getPropertyResultsMap() );
//      collectionOwnerAliases.add( ownerAlias );
    }
    else if ( returnType.isEntityType() ) {
      EntityType eType = ( EntityType ) returnType;
      String returnEntityName = eType.getAssociatedEntityName();
      SQLLoadable persister = getSQLLoadable( returnEntityName );
      addPersister( alias, fetchReturn.getPropertyResultsMap(), persister );
    }

  }
View Full Code Here


      if ( element.isFetch() ) {
        if ( element.isCollectionJoin() || element.getQueryableCollection() != null ) {
          // This is now handled earlier in this method.
        }
        else if ( element.getDataType().isEntityType() ) {
          EntityType entityType = ( EntityType ) element.getDataType();
          if ( entityType.isOneToOne() ) {
            owners[i] = fromElementList.indexOf( element.getOrigin() );
          }
          ownerAssociationTypes[i] = entityType;
        }
      }
View Full Code Here

  public ExpandingEntityQuerySpace makeEntityQuerySpace(
      ExpandingQuerySpace lhsQuerySpace,
      AssociationAttributeDefinition attribute,
      String querySpaceUid,
      FetchStrategy fetchStrategy) {
    final EntityType fetchedType = (EntityType) attribute.getType();
    final EntityPersister fetchedPersister = attribute.toEntityDefinition().getEntityPersister();

    if ( fetchedPersister == null ) {
      throw new WalkingException(
          String.format(
              "Unable to locate EntityPersister [%s] for fetch [%s]",
              fetchedType.getAssociatedEntityName(),
              attribute.getName()
          )
      );
    }
    // TODO: Queryable.isMultiTable() may be more broad than it needs to be...
View Full Code Here

  @Override
  public BidirectionalEntityReference buildBidirectionalEntityReference(
      AssociationAttributeDefinition attributeDefinition,
      FetchStrategy fetchStrategy,
      EntityReference targetEntityReference) {
    final EntityType fetchedType = (EntityType) attributeDefinition.getType();
    final EntityPersister fetchedPersister = attributeDefinition.toEntityDefinition().getEntityPersister();

    if ( fetchedPersister == null ) {
      throw new WalkingException(
          String.format(
              "Unable to locate EntityPersister [%s] for bidirectional entity reference [%s]",
              fetchedType.getAssociatedEntityName(),
              attributeDefinition.getName()
          )
      );
    }
View Full Code Here

      if ( element.isFetch() ) {
        if ( element.isCollectionJoin() || element.getQueryableCollection() != null ) {
          // This is now handled earlier in this method.
        }
        else if ( element.getDataType().isEntityType() ) {
          EntityType entityType = ( EntityType ) element.getDataType();
          if ( entityType.isOneToOne() ) {
            owners[i] = fromElementList.indexOf( element.getOrigin() );
          }
          ownerAssociationTypes[i] = entityType;
        }
      }
View Full Code Here

        throw new QueryException( me );
      }
    }
    join.addCondition( collectionName, keyColumnNames, " = ?" );
    //if ( persister.hasWhere() ) join.addCondition( persister.getSQLWhereString(collectionName) );
    EntityType elemType = ( EntityType ) collectionElementType;
    addFrom( elementName, elemType.getAssociatedEntityName(), join );

  }
View Full Code Here

        NonScalarReturn ownerDescriptor = fetchRtn.getOwner();
        int ownerIndex = nonScalarReturnList.indexOf( ownerDescriptor );
        entityOwners.add( ownerIndex );
        lockModes.add( fetchRtn.getLockMode() );
        Queryable ownerPersister = determineAppropriateOwnerPersister( ownerDescriptor );
        EntityType fetchedType = ( EntityType ) ownerPersister.getPropertyType( fetchRtn.getOwnerProperty() );
        String entityName = fetchedType.getAssociatedEntityName( getFactory() );
        Queryable persister = ( Queryable ) factory.getEntityPersister( entityName );
        entityPersisters.add( persister );
        nonScalarReturnList.add( rtn );
        specifiedAliases.add( fetchRtn.getAlias() );
        entityAliases.add( fetchRtn.getEntityAliases() );
View Full Code Here

    }
    else if ( ownerDescriptor instanceof CollectionReturn ) {
      CollectionReturn collRtn = ( CollectionReturn ) ownerDescriptor;
      String role = collRtn.getOwnerEntityName() + "." + collRtn.getOwnerProperty();
      CollectionPersister persister = getFactory().getCollectionPersister( role );
      EntityType ownerType = ( EntityType ) persister.getElementType();
      entityName = ownerType.getAssociatedEntityName( getFactory() );
    }
    else if ( ownerDescriptor instanceof FetchReturn ) {
      FetchReturn fetchRtn = ( FetchReturn ) ownerDescriptor;
      Queryable persister = determineAppropriateOwnerPersister( fetchRtn.getOwner() );
      Type ownerType = persister.getPropertyType( fetchRtn.getOwnerProperty() );
      if ( ownerType.isEntityType() ) {
        entityName = ( ( EntityType ) ownerType ).getAssociatedEntityName( getFactory() );
      }
      else if ( ownerType.isCollectionType() ) {
        Type ownerCollectionElementType = ( ( CollectionType ) ownerType ).getElementType( getFactory() );
        if ( ownerCollectionElementType.isEntityType() ) {
          entityName = ( ( EntityType ) ownerCollectionElementType ).getAssociatedEntityName( getFactory() );
        }
      }
View Full Code Here

    return rhsAlias;
  }

  private boolean isOneToOne() {
    if ( joinableType.isEntityType() )  {
      EntityType etype = (EntityType) joinableType;
      return etype.isOneToOne() /*&& etype.isReferenceToPrimaryKey()*/;
    }
    else {
      return false;
    }
  }
View Full Code Here

      if (config==FetchMode.JOIN) return true;
      if (config==FetchMode.SELECT) return false;
      if ( type.isEntityType() ) {
        //TODO: look at the owning property and check that it
        //      isn't lazy (by instrumentation)
        EntityType entityType =(EntityType) type;
        EntityPersister persister = getFactory().getEntityPersister( entityType.getAssociatedEntityName() );
        return !persister.hasProxy();
      }
      else {
        return false;
      }
View Full Code Here

TOP

Related Classes of org.hibernate.type.EntityType

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.