Package org.hibernate.type

Examples of org.hibernate.type.Type


  }

  public void end(QueryTranslatorImpl q) throws QueryException {
    ignoreInitialJoin = false;

    Type propertyType = getPropertyType();
    if ( propertyType != null && propertyType.isCollectionType() ) {
      collectionRole = ( ( CollectionType ) propertyType ).getRole();
      collectionName = q.createNameForCollection( collectionRole );
      prepareForIndex( q );
    }
    else {
View Full Code Here


      return currentName;
    }
  }

  public String addFromCollection(QueryTranslatorImpl q) throws QueryException {
    Type collectionElementType = getPropertyType();

    if ( collectionElementType == null ) {
      throw new QueryException( "must specify 'elements' for collection valued property in from clause: " + path );
    }

    if ( collectionElementType.isEntityType() ) {
      // an association
      QueryableCollection collectionPersister = q.getCollectionPersister( collectionRole );
      Queryable entityPersister = ( Queryable ) collectionPersister.getElementPersister();
      String clazz = entityPersister.getEntityName();
View Full Code Here

      node.setType( SqlTokenTypes.NUM_FLOAT );
    }
    else {
      node.setType( SqlTokenTypes.CONSTANT );
    }
    Type type;
    try {
      type = TypeFactory.heuristicType( value.getClass().getName() );
    }
    catch ( MappingException me ) {
      throw new QueryException( me );
View Full Code Here

  public void resolveInFunctionCall(boolean generateJoin, boolean implicitJoin) throws SemanticException {
    if ( isResolved() ) {
      return;
    }
    Type propertyType = prepareLhs();      // Prepare the left hand side and get the data type.
    if ( propertyType!=null && propertyType.isCollectionType() ) {
      resolveIndex(null);
    }
    else {
      resolveFirstChild();
      super.resolve(generateJoin, implicitJoin);
View Full Code Here

  public void resolveIndex(AST parent) throws SemanticException {
    if ( isResolved() ) {
      return;
    }
    Type propertyType = prepareLhs();      // Prepare the left hand side and get the data type.
    dereferenceCollection( ( CollectionType ) propertyType, true, true, null, parent );
  }
View Full Code Here

  throws SemanticException {
    // If this dot has already been resolved, stop now.
    if ( isResolved() ) {
      return;
    }
    Type propertyType = prepareLhs(); // Prepare the left hand side and get the data type.

    // If there is no data type for this node, and we're at the end of the path (top most dot node), then
    // this might be a Java constant.
    if ( propertyType == null ) {
      if ( parent == null ) {
        getWalker().getLiteralProcessor().lookupConstant( this );
      }
      // If the propertyType is null and there isn't a parent, just
      // stop now... there was a problem resolving the node anyway.
      return;
    }

    if ( propertyType.isComponentType() ) {
      // The property is a component...
      checkLhsIsNotCollection();
      dereferenceComponent( parent );
      initText();
    }
    else if ( propertyType.isEntityType() ) {
      // The property is another class..
      checkLhsIsNotCollection();
      dereferenceEntity( ( EntityType ) propertyType, implicitJoin, classAlias, generateJoin, parent );
      initText();
    }
    else if ( propertyType.isCollectionType() ) {
      // The property is a collection...
      checkLhsIsNotCollection();
      dereferenceCollection( ( CollectionType ) propertyType, implicitJoin, false, classAlias, parent );
    }
    else {
View Full Code Here

      FromElement fromElement = getLhs().getFromElement();
      if ( fromElement == null ) {
        return null;
      }
      // If the lhs is a collection, use CollectionPropertyMapping
      Type propertyType = fromElement.getPropertyType( propertyName, propertyPath );
      if ( log.isDebugEnabled() ) {
        log.debug( "getDataType() : " + propertyPath + " -> " + propertyType );
      }
      super.setDataType( propertyType );
    }
View Full Code Here

    if ( getWalker().isShallowQuery() || getWalker().getCurrentFromClause().isSubQuery() ) {
      resolve(false, true);
    }
    else {
      resolve(true, false);
      Type type = getDataType();
      if ( type.isEntityType() ) {
        FromElement fromElement = getFromElement();
        fromElement.setIncludeSubclasses( true ); // Tell the destination fromElement to 'includeSubclasses'.
        if ( useThetaStyleImplicitJoins ) {
          fromElement.getJoinSequence().setUseThetaStyle( true )// Use theta style (for regression)
          // Move the node up, after the origin node.
View Full Code Here

    // super-duper-classic-parser-regression-testing-mojo-magic...
    if ( explicitSubqueryFromElement && DotNode.useThetaStyleImplicitJoins ) {
      implied = true;
    }

    Type elementType = queryableCollection.getElementType();
    if ( elementType.isEntityType() ) {       // A collection of entities...
      elem = createEntityAssociation( role, roleAlias, joinType );
    }
    else if ( elementType.isComponentType() ) {    // A collection of components...
      JoinSequence joinSequence = createJoinSequence( roleAlias, joinType );
      elem = createCollectionJoin( joinSequence, roleAlias );
    }
    else {                      // A collection of scalar elements...
      JoinSequence joinSequence = createJoinSequence( roleAlias, joinType );
View Full Code Here

  FromElement createElementJoin(QueryableCollection queryableCollection) throws SemanticException {
    FromElement elem;

    implied = true; //TODO: always true for now, but not if we later decide to support elements() in the from clause
    inElementsFunction = true;
    Type elementType = queryableCollection.getElementType();
    if ( !elementType.isEntityType() ) {
      throw new IllegalArgumentException( "Cannot create element join for a collection of non-entities!" );
    }
    this.queryableCollection = queryableCollection;
    SessionFactoryHelper sfh = fromClause.getSessionFactoryHelper();
    FromElement destination = null;
View Full Code Here

TOP

Related Classes of org.hibernate.type.Type

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.