Examples of TupleAsMapResultSet


Examples of org.hibernate.ogm.jdbc.TupleAsMapResultSet

  public void setTuples(List<Tuple> tuples) {
    if ( tuples == null ) {
      this.resultSet = null;
    }
    else {
      TupleAsMapResultSet tupleResultSet = new TupleAsMapResultSet();
      tupleResultSet.setTuples( tuples );
      this.resultSet = tupleResultSet;
    }
  }
View Full Code Here

Examples of org.hibernate.ogm.jdbc.TupleAsMapResultSet

      id = null;
    }
    else {
      id = qp.getCollectionKeys()[0];
    }
    TupleAsMapResultSet resultset = getResultSet( id, ogmLoadingContext, session );

    //Todo implement lockmode
    //final LockMode[] lockModesArray = getLockModes( queryParameters.getLockOptions() );
    //FIXME should we use subselects as it's closer to this process??

    //TODO is resultset a good marker, or should it be an ad-hoc marker??
    //It likely all depends on what resultset ends up being
    handleEmptyCollections( qp.getCollectionKeys(), resultset, session );

    final org.hibernate.engine.spi.EntityKey[] keys = new org.hibernate.engine.spi.EntityKey[entitySpan];

    //for each element in resultset
    //TODO should we collect List<Object> as result? Not necessary today
    Object result = null;
    List<Object> results = new ArrayList<Object>();
    try {
      while ( resultset.next() ) {
        result = getRowFromResultSet(
            resultset,
            session,
            qp,
            ogmLoadingContext,
View Full Code Here

Examples of org.hibernate.ogm.jdbc.TupleAsMapResultSet

    int entitySpan = entityPersisters.length;
    final List<Object> hydratedObjects = entitySpan == 0 ? null : new ArrayList<Object>( entitySpan * 10 );
    //TODO yuk! Is there a cleaner way to access the id?
    final Serializable id = qp.getOptionalId() != null ? qp.getOptionalId() : ( Serializable ) qp.getCollectionKeys()[0];
    TupleAsMapResultSet resultset = getResultSet( id, session );

    //Todo implement lockmode
    //final LockMode[] lockModesArray = getLockModes( queryParameters.getLockOptions() );
    //FIXME should we use subselects as it's closer to this process??

    //TODO is resultset a good marker, or should it be an ad-hoc marker??
    //It likely all depends on what resultset ends up being
    handleEmptyCollections( qp.getCollectionKeys(), resultset, session );

    final org.hibernate.engine.EntityKey[] keys = new org.hibernate.engine.EntityKey[entitySpan];

    //for each element in resultset
    //TODO should we collect List<Object> as result? Not necessary today
    Object result = null;
    try {
      while ( resultset.next() ) {
        result = getRowFromResultSet(
            resultset,
            session,
            qp,
            //lockmodeArray,
View Full Code Here

Examples of org.hibernate.ogm.jdbc.TupleAsMapResultSet

    }
  }

  private TupleAsMapResultSet getResultSet(Serializable id, SessionImplementor session) {
    //TODO this if won't work when we will support collections inside the entity tuple but that will do for now
    final TupleAsMapResultSet resultset = new TupleAsMapResultSet();
    if ( getEntityPersisters().length > 0 ) {
      final Cache<EntityKey, Map<String, Object>> entityCache = GridMetadataManagerHelper.getEntityCache( gridManager );
      final EntityKey key = new EntityKeyBuilder()
          .entityPersister( getEntityPersisters()[0] )
          .id( id )
          .getKey();
      final Map<String,Object> entry = gridManager.getGridDialect().getTuple( key, entityCache );
      if ( entry != null ) {
        resultset.addTuple( entry );
      }
    }
    else {
      //collection persister
      if ( getCollectionPersisters().length != 1 ) {
        throw new AssertionFailure( "Found an unexpected number of collection persisters: " + getCollectionPersisters().length );
      }
      final CollectionPhysicalModel persister = (CollectionPhysicalModel) getCollectionPersisters()[0];
      PropertyMetadataProvider metadataProvider = new PropertyMetadataProvider()
        .gridManager( gridManager )
        .tableName( persister.getTableName() )
        .key( id )
        .keyColumnNames( persister.getKeyColumnNames() )
        .keyGridType( persister.getKeyGridType() )
        .session( session );
      final Map<RowKey,Map<String,Object>> entry = metadataProvider.getCollectionMetadataOrNull();
      if ( entry != null ) {
        for ( Map<String,Object> tuple : entry.values() ) {
          resultset.addTuple( tuple );
        }
      }
    }
    return resultset;
  }
View Full Code Here

Examples of org.hibernate.ogm.jdbc.TupleAsMapResultSet

  }

  @Override
  public Object readKey(ResultSet rs, String[] aliases, SessionImplementor session)
  throws HibernateException, SQLException {
    final TupleAsMapResultSet resultset = rs.unwrap( TupleAsMapResultSet.class );
    final Map<String,Object> keyTuple = resultset.getTuple();
    return keyGridType.nullSafeGet( keyTuple, aliases, session, null );
  }
View Full Code Here

Examples of org.hibernate.ogm.jdbc.TupleAsMapResultSet

  }

  @Override
  public Object readElement(ResultSet rs, Object owner, String[] aliases, SessionImplementor session)
  throws HibernateException, SQLException {
    final TupleAsMapResultSet resultset = rs.unwrap( TupleAsMapResultSet.class );
    final Map<String,Object> keyTuple = resultset.getTuple();
    return elementGridType.nullSafeGet( keyTuple, aliases, session, owner );
  }
View Full Code Here

Examples of org.hibernate.ogm.jdbc.TupleAsMapResultSet

  }

  @Override
  public Object readIdentifier(ResultSet rs, String alias, SessionImplementor session)
      throws HibernateException, SQLException {
    final TupleAsMapResultSet resultset = rs.unwrap( TupleAsMapResultSet.class );
    final Map<String,Object> keyTuple = resultset.getTuple();
    return identifierGridType.nullSafeGet( keyTuple, alias, session, null );
  }
View Full Code Here

Examples of org.hibernate.ogm.jdbc.TupleAsMapResultSet

  }

  @Override
  public Object readIndex(ResultSet rs, String[] aliases, SessionImplementor session)
      throws HibernateException, SQLException {
    final TupleAsMapResultSet resultset = rs.unwrap( TupleAsMapResultSet.class );
    final Map<String,Object> keyTuple = resultset.getTuple();
    return indexGridType.nullSafeGet( keyTuple, aliases, session, null );
  }
View Full Code Here

Examples of org.hibernate.ogm.jdbc.TupleAsMapResultSet

  }

  @Override
  public Object readKey(ResultSet rs, String[] aliases, SessionImplementor session)
      throws HibernateException, SQLException {
    final TupleAsMapResultSet resultset = rs.unwrap( TupleAsMapResultSet.class );
    final Tuple keyTuple = resultset.getTuple();
    return keyGridType.nullSafeGet( keyTuple, aliases, session, null );
  }
View Full Code Here

Examples of org.hibernate.ogm.jdbc.TupleAsMapResultSet

  }

  @Override
  public Object readElement(ResultSet rs, Object owner, String[] aliases, SessionImplementor session)
      throws HibernateException, SQLException {
    final TupleAsMapResultSet resultset = rs.unwrap( TupleAsMapResultSet.class );
    final Tuple keyTuple = resultset.getTuple();
    return elementGridType.nullSafeGet( keyTuple, aliases, session, owner );
  }
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.