Package org.hibernate.type

Examples of org.hibernate.type.EntityType


      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


        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

      throw new IdentifierGenerationException(
          "attempted to assign id from null one-to-one property [" + getRole() + "]"
      );
    }
   
    EntityType type = (EntityType) sessionImplementor.getFactory()
          .getClassMetadata( entityName )
          .getPropertyType( propertyName );

    Serializable id;
    try {
      id = ForeignKeys.getEntityIdentifierIfNotUnsaved(
          type.getAssociatedEntityName(),
          associatedObject,
          sessionImplementor
      );
    }
    catch (TransientObjectException toe) {
      id = session.save( type.getAssociatedEntityName(), associatedObject );
    }

    if ( session.contains(object) ) {
      //abort the save (the object is already saved by a circular cascade)
      return IdentifierGeneratorHelper.SHORT_CIRCUIT_INDICATOR;
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

    return rhsAlias;
  }

  private boolean isOneToOne() {
    if ( joinableType.isEntityType() )  {
      EntityType etype = (EntityType) joinableType;
      return etype.isOneToOne() /*&& etype.isReferenceToPrimaryKey()*/;
    }
    else {
      return false;
    }
  }
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

      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

      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

        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( new Integer( 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

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.