Class ProjectionReferredTypeOverride


  • public class ProjectionReferredTypeOverride
    extends Object
    Represents an override of a type to use during Json deserialization. Most notably, this allows for nested types in an incoming projection instance to be recognized as a more derived type provided by a customization extension. This is especially useful for overriding things like collection field member types. Note, the overridden type may be nested arbitrarily deep in the object graph of the projection and need not be directly reference from the projection type itself.
    • Constructor Detail

      • ProjectionReferredTypeOverride

        public ProjectionReferredTypeOverride​(Class<?> originalProjectionType,
                                              Class<?> derivedProjectionType)
    • Method Detail

      • withRepositoryMapTo

        public ProjectionReferredTypeOverride withRepositoryMapTo​(Class<?> originalMapToType,
                                                                  Class<?> derivedMapToType)
        If the projection is mapped to a repository domain type, then original and extended repository domain types are set here. In some cases with embedded collections with no JPA counterpart, the collection type on the projection is exactly the same as on the repository type. In this case, withMapTo should not be used.
      • getOriginalProjectionType

        public Class<?> getOriginalProjectionType()
        The starting projection type that will be customized via extension
      • getDerivedProjectionType

        public Class<?> getDerivedProjectionType()
        The extended projection type
      • getOriginalMapToType

        public Class<?> getOriginalMapToType()
        If the projection is mapped to a repository domain type, then this represents the repository domain type that will be customized via extension. In some cases with embedded collections with no JPA counterpart, the collection type on the projection is exactly the same as on the repository type. In this case, originalMapToType should not be specified.
      • getDerivedMapToType

        public Class<?> getDerivedMapToType()
        If the projection is mapped to a repository domain type, then this represents the extended repository domain type. In some cases with embedded collections with no JPA counterpart, the collection type on the projection is exactly the same as on the repository type. In this case, derivedMapToType should not be specified.
      • setOriginalMapToType

        public void setOriginalMapToType​(Class<?> originalMapToType)
        If the projection is mapped to a repository domain type, then this represents the repository domain type that will be customized via extension. In some cases with embedded collections with no JPA counterpart, the collection type on the projection is exactly the same as on the repository type. In this case, originalMapToType should not be specified.
      • setDerivedMapToType

        public void setDerivedMapToType​(Class<?> derivedMapToType)
        If the projection is mapped to a repository domain type, then this represents the extended repository domain type. In some cases with embedded collections with no JPA counterpart, the collection type on the projection is exactly the same as on the repository type. In this case, derivedMapToType should not be specified.
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object