Package org.hibernate.ogm.loader.impl

Source Code of org.hibernate.ogm.loader.impl.OgmLoadingContext

/*
* Hibernate OGM, Domain model persistence for NoSQL datastores
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ogm.loader.impl;

import org.hibernate.ogm.jdbc.impl.TupleAsMapResultSet;
import org.hibernate.ogm.model.spi.Tuple;

import java.util.List;

/**
* Object holding contextual information around data loading
* and that are OGM specific. This object is used by {@link OgmLoader}.
*
* @author Emmanuel Bernard &lt;emmanuel@hibernate.org&gt;
*/
public class OgmLoadingContext {
  /**
   * Do not edit this reference. Shared by everyone and still mutable.
   */
  public static final OgmLoadingContext EMPTY_CONTEXT = new OgmLoadingContext();

  private TupleAsMapResultSet resultSet;

  public boolean hasResultSet() {
    return resultSet != null;
  }

  public TupleAsMapResultSet getResultSet() {
    return resultSet;
  }

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

Related Classes of org.hibernate.ogm.loader.impl.OgmLoadingContext

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.