Package fr.gouv.vitam.metadata.core.database.collections

# Class MongoDbMetadataHelper

java.lang.Object
fr.gouv.vitam.metadata.core.database.collections.MongoDbMetadataHelper

@Deprecated public class MongoDbMetadataHelper extends Object
Deprecated.
use `MongoDbMetadataRepository`
MongoDb Helper for Metadata

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Result`
  `createOneResult(BuilderToken.FILTERARGS type)`
  Deprecated.
  `static Result`
  `createOneResult(BuilderToken.FILTERARGS type, Collection<String> set)`
  Deprecated.
  `static final com.mongodb.client.result.DeleteResult`
  `delete(MetadataCollections collection, org.bson.conversions.Bson condition, int nb)`
  Deprecated.
  `static final MetadataDocument`
  `findOne(MetadataCollections col, String id)`
  Deprecated.
  Find the corresponding id in col collection if it exists.
  `static final org.bson.conversions.Bson`
  `queryForAncestorsOrSame(Collection<String> targetIds, Collection<String> ancestorIds)`
  Deprecated.
  Used to filter Units/OG according to some Units ancestors
  `static final com.mongodb.client.FindIterable<?>`
  `select(MetadataCollections collection, org.bson.conversions.Bson condition, org.bson.conversions.Bson projection)`
  Deprecated.
  Does not call getAfterLoad.
  `static final com.mongodb.client.FindIterable<?>`
  `select(MetadataCollections collection, org.bson.conversions.Bson condition, org.bson.conversions.Bson projection, org.bson.conversions.Bson orderBy, int offset, int limit)`
  Deprecated.
  Does not call getAfterLoad.
  `static final com.mongodb.client.FindIterable<?>`
  `selectFiltered(com.mongodb.client.FindIterable<?> find, org.bson.conversions.Bson orderBy, int offset, int limit)`
  Deprecated.
  Aff orderBy and offset and limit if not null or not -1

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### findOne

    public static final MetadataDocument findOne(MetadataCollections col, String id)
    Deprecated.
    Find the corresponding id in col collection if it exists. Calls getAfterLoad
    Parameters:
      `col` - (not results except if already hashed) the working collection
      `id` - the id value for searching in collection field
    Returns:
      the MetadataDocument casted object using ID = id

  - ### select

    public static final com.mongodb.client.FindIterable<?> select(MetadataCollections collection, org.bson.conversions.Bson condition, org.bson.conversions.Bson projection)
    Deprecated.
    Does not call getAfterLoad.
    Parameters:
      `collection` - domain of request
      `condition` - where condition
      `projection` - select condition
    Returns:
      the FindIterable on the find request based on the given collection

  - ### select

    public static final com.mongodb.client.FindIterable<?> select(MetadataCollections collection, org.bson.conversions.Bson condition, org.bson.conversions.Bson projection, org.bson.conversions.Bson orderBy, int offset, int limit)
    Deprecated.
    Does not call getAfterLoad.
    Parameters:
      `collection` - domain of request
      `condition` - where condition
      `projection` - select condition
      `orderBy` - orderBy condition
      `offset` - offset (0 by default)
      `limit` - limit (0 for no limit)
    Returns:
      the FindIterable on the find request based on the given collection

  - ### selectFiltered

    public static final com.mongodb.client.FindIterable<?> selectFiltered(com.mongodb.client.FindIterable<?> find, org.bson.conversions.Bson orderBy, int offset, int limit)
    Deprecated.
    Aff orderBy and offset and limit if not null or not -1
    Parameters:
      `find` -
      `orderBy` -
      `offset` -
      `limit` -
    Returns:
      the modified FindIterable

  - ### delete

    public static final com.mongodb.client.result.DeleteResult delete(MetadataCollections collection, org.bson.conversions.Bson condition, int nb) throws MetaDataExecutionException
    Deprecated.
    Parameters:
      `collection` - domain of request
      `condition` - where condition
      `nb` - nb of item to delete
    Returns:
      the DeleteResult on the update request based on the given collection
    Throws:
      `MetaDataExecutionException` - if a mongo operation exception occurred

  - ### queryForAncestorsOrSame

    public static final org.bson.conversions.Bson queryForAncestorsOrSame(Collection<String> targetIds, Collection<String> ancestorIds)
    Deprecated.
    Used to filter Units/OG according to some Units ancestors
    Parameters:
      `targetIds` - set of target ids
      `ancestorIds` - set of ancestor ids
    Returns:
      the Filter condition to find if ancestorIds are ancestors of targetIds or equals to targetIds

  - ### createOneResult

    public static Result createOneResult(BuilderToken.FILTERARGS type)
    Deprecated.
    Parameters:
      `type` - of filter
    Returns:
      a new Result

  - ### createOneResult

    public static Result createOneResult(BuilderToken.FILTERARGS type, Collection<String> set)
    Deprecated.
    Parameters:
      `type` - of filter
      `set` - of collection for creating Result
    Returns:
      a new Result