Enum Class NoOpDbRefResolver

java.lang.Object
java.lang.Enum<NoOpDbRefResolver>
org.springframework.data.mongodb.core.convert.NoOpDbRefResolver
All Implemented Interfaces:
Serializable, Comparable<NoOpDbRefResolver>, Constable, DbRefResolver, ReferenceResolver

public enum NoOpDbRefResolver extends Enum<NoOpDbRefResolver> implements DbRefResolver
No-Operation DBRef resolver throwing UnsupportedOperationException when attempting to resolve database references.
Since:
2.1
Author:
Mark Paluch, Christoph Strobl
  • Enum Constant Details

  • Method Details

    • values

      public static NoOpDbRefResolver[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NoOpDbRefResolver valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • resolveDbRef

      @Nullable public Object resolveDbRef(MongoPersistentProperty property, @Nullable com.mongodb.DBRef dbref, DbRefResolverCallback callback, DbRefProxyHandler proxyHandler)
      Description copied from interface: DbRefResolver
      Resolves the given DBRef into an object of the given MongoPersistentProperty's type. The method might return a proxy object for the DBRef or resolve it immediately. In both cases the DbRefResolverCallback will be used to obtain the actual backing object.
      Specified by:
      resolveDbRef in interface DbRefResolver
      Parameters:
      property - will never be null.
      dbref - the DBRef to resolve.
      callback - will never be null.
      Returns:
      can be null.
    • fetch

      @Nullable public org.bson.Document fetch(com.mongodb.DBRef dbRef)
      Description copied from interface: DbRefResolver
      Actually loads the DBRef from the datasource.
      Specified by:
      fetch in interface DbRefResolver
      Parameters:
      dbRef - must not be null.
      Returns:
      can be null.
    • bulkFetch

      public List<org.bson.Document> bulkFetch(List<com.mongodb.DBRef> dbRefs)
      Description copied from interface: DbRefResolver
      Loads a given List of DBRefs from the datasource in one batch. The resulting List of Document will reflect the ordering of the DBRef passed in.
      The DBRef elements in the list must not reference different collections.
      Specified by:
      bulkFetch in interface DbRefResolver
      Parameters:
      dbRefs - must not be null.
      Returns:
      never null.
    • resolveReference

      @Nullable public Object resolveReference(MongoPersistentProperty property, Object source, ReferenceLookupDelegate referenceLookupDelegate, ReferenceResolver.MongoEntityReader entityReader)
      Description copied from interface: ReferenceResolver
      Resolve the association defined via the given property from a given source value. May return a proxy instance in case of a lazy loading association. The resolved value is assignable to PersistentProperty.getType().
      Specified by:
      resolveReference in interface ReferenceResolver
      Parameters:
      property - the association defining property.
      source - the association source value.
      referenceLookupDelegate - the lookup executing component.
      entityReader - conversion function capable of constructing entities from raw source.
      Returns:
      can be null.