Class SingleUseEntityMapper

java.lang.Object
org.neo4j.ogm.context.SingleUseEntityMapper

public class SingleUseEntityMapper extends Object
Simple graph-to-entity mapper suitable for ad-hoc, one-off mappings. This doesn't interact with a mapping context or mandate graph IDs on the target types and is not designed for use in the OGM session.
Author:
Adam George, Luanne Misquitta, Michael J. Simons
  • Constructor Details

    • SingleUseEntityMapper

      public SingleUseEntityMapper(MetaData mappingMetaData, EntityFactory entityFactory)
      Compatibility constructor for SDN 5.0 and 5.1
      Parameters:
      mappingMetaData - The MetaData to use for performing mappings
      entityFactory - The entity factory to use.
    • SingleUseEntityMapper

      public SingleUseEntityMapper(MetaData mappingMetaData, EntityInstantiator entityInstantiator)
      Constructs a new SingleUseEntityMapper based on the given mapping MetaData.
      Parameters:
      mappingMetaData - The MetaData to use for performing mappings
      entityInstantiator - The entity factory to use.
  • Method Details

    • map

      public <T> T map(Class<T> type, String[] columnNames, org.neo4j.ogm.model.RowModel rowModel)
      Maps a row-based result onto a new instance of the specified type.
      Type Parameters:
      T - The class of object to return
      Parameters:
      type - The Class denoting the type of object to create
      columnNames - The names of the columns in each row of the result
      rowModel - The RowModel containing the data to map
      Returns:
      A new instance of T populated with the data in the specified row model
    • map

      public <T> T map(Class<T> type, Map<String,Object> row)