Enum Class 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.
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.
      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.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      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
      property - will never be null.
      dbref - the DBRef to resolve.
      callback - will never be null.
      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
      dbRef - must not be null.
      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
      dbRefs - must not be null.
      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
      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.
      can be null.