Interface MapAttribute<X,​K,​V>

Type Parameters:
X - The type of the declaring entity view
K - The type of the key of the represented Map
V - The type of the value of the represented Map
All Superinterfaces:
Attribute<X,​Map<K,​V>>, PluralAttribute<X,​Map<K,​V>,​V>
All Known Subinterfaces:
MethodMapAttribute<X,​K,​V>, MethodMultiMapAttribute<X,​K,​V,​C>

public interface MapAttribute<X,​K,​V>
extends PluralAttribute<X,​Map<K,​V>,​V>
Instances of the type MapAttribute represent persistent Map-valued attributes.
Since:
1.0.0
Author:
Christian Beikov
  • Method Details

    • getKeyType

      Type<K> getKeyType()
      Returns the java type of the key.
      Returns:
      The java type of the key
    • getKeyInheritanceSubtypeMappings

      Map<ManagedViewType<? extends K>,​String> getKeyInheritanceSubtypeMappings()
      Returns the inheritance subtypes that should be considered for the keys of this map attribute. When the key type of the map attribute is not a subview, this returns an empty set.
      Returns:
      The inheritance subtypes or an empty set
      Since:
      1.2.0
    • isKeySubview

      boolean isKeySubview()
      Returns true if the key of this map attribute is a subview, otherwise false.
      Returns:
      True if the key of this map attribute is a subview, otherwise false
      Since:
      1.2.0
    • getMapInstantiator

      <R extends Map<K,​ V> & RecordingContainer<? extends Map<K,​ V>>> MapInstantiator<Map<K,​V>,​R> getMapInstantiator()
      Returns the map instantiator for this attribute.
      Type Parameters:
      R - The recording map type
      Returns:
      The map instantiator
      Since:
      1.5.0
    • getKeyMapping

      String getKeyMapping()
      Returns the key mapping of the attribute.
      Returns:
      The key mapping of the attribute
      Since:
      1.5.0
    • getKeyFetches

      String[] getKeyFetches()
      The associations that should be fetched along with the entity mapped by the key of this attribute.
      Returns:
      The association that should be fetched
      Since:
      1.5.0
    • renderKeyMapping

      void renderKeyMapping​(String parent, ServiceProvider serviceProvider, StringBuilder sb)
      Renders the key mapping for the given parent expression to the given string builder.
      Parameters:
      parent - The parent expression
      serviceProvider - The service provider
      sb - The string builder
      Since:
      1.5.0