Examples of GridType


Examples of org.hibernate.ogm.type.spi.GridType

      return null;
    }

    //TODO should we cache results? It seems an actual HashMap might be slower but it makes it more robust
    //     against badly written dialects
    GridType dialectType = dialect.overrideType( type );
    if ( dialectType != null ) {
      return dialectType;
    }
    else if ( type instanceof AbstractStandardBasicType ) {
      AbstractStandardBasicType<?> exposedType = (AbstractStandardBasicType<?>) type;
      final GridType gridType = typeConverter.get( exposedType.getJavaTypeDescriptor() );
      if (gridType == null) {
        throw log.unableToFindGridType( exposedType.getJavaTypeDescriptor().getJavaTypeClass().getName() );
      }
      return gridType;
    }
View Full Code Here

Examples of org.hibernate.ogm.type.spi.GridType

  /**
   * Returns the object referenced by the specified property (which represents an association).
   */
  private Object getReferencedEntity(int propertyIndex) {
    GridType propertyType = persister.getGridPropertyTypes()[propertyIndex];

    Serializable id = (Serializable) propertyType.hydrate(
        resultset, persister.getPropertyColumnNames( propertyIndex ), session, null
    );

    if ( id != null ) {
      EntityPersister hostingEntityPersister = session.getFactory().getEntityPersister(
          propertyType.getReturnedClass().getName()
      );

      return session.getPersistenceContext().getEntity(
          session.generateEntityKey( id, hostingEntityPersister )
      );
View Full Code Here

Examples of org.hibernate.ogm.type.spi.GridType

      Tuple tuple = tuples.next();
      Object[] entry = new Object[queryReturnTypes.length];

      int i = 0;
      for ( Type type : queryReturnTypes ) {
        GridType gridType = typeTranslator.getType( type );
        entry[i] = gridType.nullSafeGet( tuple, scalarColumns.get( i ), session, null );
        i++;
      }

      if ( entry.length == 1 ) {
        results.add( entry[0] );
View Full Code Here

Examples of org.hibernate.ogm.type.spi.GridType

        for ( Return queryReturn : customQuery.getCustomQueryReturns() ) {
          ScalarReturn scalarReturn = (ScalarReturn) queryReturn;
          Type type = scalarReturn.getType();

          if ( type != null ) {
            GridType gridType = typeTranslator.getType( type );
            entry[i++] = gridType.nullSafeGet( tuple, scalarReturn.getColumnAlias(), session, null );
          }
          else {
            entry[i++] = tuple.get( scalarReturn.getColumnAlias() );
          }
        }
View Full Code Here

Examples of org.hibernate.ogm.type.spi.GridType

  }

  @Override
  public void nullSafeSet(Tuple resultset, Object value, String[] names, boolean[] settable, SessionImplementor session)
      throws HibernateException {
    GridType idGridType = getIdGridType( session );
    idGridType.nullSafeSet( resultset, getIdentifier( value, session ), names, settable, session );
  }
View Full Code Here

Examples of org.hibernate.ogm.type.spi.GridType

    idGridType.nullSafeSet( resultset, getIdentifier( value, session ), names, settable, session );
  }

  private GridType getIdGridType(SessionImplementor session) {
    final Type idType = delegate.getIdentifierOrUniqueKeyType( session.getFactory() );
    GridType idGridType = typeTranslator.getType( idType );
    return idGridType;
  }
View Full Code Here

Examples of org.hibernate.ogm.type.spi.GridType

  }

  @Override
  public void nullSafeSet(Tuple resultset, Object value, String[] names, SessionImplementor session)
      throws HibernateException {
    GridType idGridType = getIdGridType( session );
    idGridType.nullSafeSet( resultset, getIdentifier( value, session ), names, session );
  }
View Full Code Here

Examples of org.hibernate.ogm.type.spi.GridType

      String propertyName,
      Object uniqueKey,
      SessionImplementor session) throws HibernateException {
    //we get the property type for an associated entity
    final int propertyIndex = getPropertyIndex( propertyName );
    final GridType gridUniqueKeyType = getUniqueKeyTypeFromAssociatedEntity( propertyIndex, propertyName );
    //get the associated property index (to get its column names)
    //find the ids per unique property name
    AssociationKeyMetadata associationKeyMetadata = inverseOneToOneAssociationKeyMetadata.get( propertyName );
    if ( associationKeyMetadata == null ) {
      throw new AssertionFailure( "loadByUniqueKey on a non EntityType:" + propertyName );
View Full Code Here

Examples of org.hibernate.ogm.type.spi.GridType

              + " value: " + uniqueKey );
    }
  }

  private GridType getUniqueKeyTypeFromAssociatedEntity(int propertyIndex, String propertyName) {
    GridType gridUniqueKeyType;//get the unique key type and if it's an entity type, get it's identifier type
    final Type uniqueKeyType = getPropertyTypes()[propertyIndex];
    if ( uniqueKeyType.isEntityType() ) {
      //we run under the assumption that we are fully in an OGM world
      EntityType entityType = (EntityType) uniqueKeyType;
      final OgmEntityPersister entityPersister = (OgmEntityPersister) entityType.getAssociatedJoinable( getFactory() );
View Full Code Here

Examples of org.hibernate.ogm.type.spi.GridType

            for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) {
              boolean include = includeOldField[i] &&
                  isPropertyOfTable( i, j ) &&
                  versionability[i]; //TODO: is this really necessary????
              if ( include ) {
                final GridType type = types[i];
                //FIXME what do do with settable?
                boolean[] settable = type.toColumnNullness( oldFields[i], factory );
                final Object snapshotValue = type.nullSafeGet(
                    resultset, getPropertyColumnNames( i ), session, object
                    );

                if ( !type.isEqual( oldFields[i], snapshotValue, factory ) ) {
                  raiseStaleObjectStateException( id );
                }
              }
            }
          }
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.