Interface ManagedType<X>

Type Parameters:
X - The represented type.
All Superinterfaces:
Type<X>
All Known Subinterfaces:
EmbeddableType<X>, EntityType<X>, IdentifiableType<X>, MappedSuperclassType<X>

public interface ManagedType<X> extends Type<X>
Instances of the type ManagedType represent entity, mapped superclass, and embeddable types.
Since:
2.0
  • Method Details

    • getAttributes

      @Nonnull Set<Attribute<? super X, ?>> getAttributes()
      Return the attributes of the managed type.
      Returns:
      attributes of the managed type
    • getDeclaredAttributes

      @Nonnull Set<Attribute<X,?>> getDeclaredAttributes()
      Return the attributes declared by the managed type. Returns empty set if the managed type has no declared attributes.
      Returns:
      declared attributes of the managed type
    • getSingularAttribute

      @Nonnull <Y> SingularAttribute<? super X, Y> getSingularAttribute(@Nonnull String name, @Nonnull Class<Y> type)
      Return the single-valued attribute of the managed type that corresponds to the specified name and Java type.
      Type Parameters:
      Y - The type of the represented attribute
      Parameters:
      name - the name of the represented attribute
      type - the type of the represented attribute
      Returns:
      single-valued attribute with given name and type
      Throws:
      IllegalArgumentException - if attribute of the given name and type is not present in the managed type
    • getDeclaredSingularAttribute

      @Nonnull <Y> SingularAttribute<X,Y> getDeclaredSingularAttribute(@Nonnull String name, @Nonnull Class<Y> type)
      Return the single-valued attribute declared by the managed type that corresponds to the specified name and Java type.
      Type Parameters:
      Y - The type of the represented attribute
      Parameters:
      name - the name of the represented attribute
      type - the type of the represented attribute
      Returns:
      declared single-valued attribute of the given name and type
      Throws:
      IllegalArgumentException - if attribute of the given name and type is not declared in the managed type
    • getSingularAttributes

      @Nonnull Set<SingularAttribute<? super X, ?>> getSingularAttributes()
      Return the single-valued attributes of the managed type. Returns empty set if the managed type has no single-valued attributes.
      Returns:
      single-valued attributes
    • getDeclaredSingularAttributes

      @Nonnull Set<SingularAttribute<X,?>> getDeclaredSingularAttributes()
      Return the single-valued attributes declared by the managed type. Returns empty set if the managed type has no declared single-valued attributes.
      Returns:
      declared single-valued attributes
    • getCollection

      @Nonnull <E> CollectionAttribute<? super X, E> getCollection(@Nonnull String name, @Nonnull Class<E> elementType)
      Return the Collection-valued attribute of the managed type that corresponds to the specified name and Java element type.
      Type Parameters:
      E - The element type of the represented collection
      Parameters:
      name - the name of the represented attribute
      elementType - the element type of the represented attribute
      Returns:
      CollectionAttribute of the given name and element type
      Throws:
      IllegalArgumentException - if attribute of the given name and type is not present in the managed type
    • getDeclaredCollection

      @Nonnull <E> CollectionAttribute<X,E> getDeclaredCollection(@Nonnull String name, @Nonnull Class<E> elementType)
      Return the Collection-valued attribute declared by the managed type that corresponds to the specified name and Java element type.
      Type Parameters:
      E - The element type of the represented collection
      Parameters:
      name - the name of the represented attribute
      elementType - the element type of the represented attribute
      Returns:
      declared CollectionAttribute of the given name and element type
      Throws:
      IllegalArgumentException - if attribute of the given name and type is not declared in the managed type
    • getSet

      @Nonnull <E> SetAttribute<? super X, E> getSet(@Nonnull String name, @Nonnull Class<E> elementType)
      Return the Set-valued attribute of the managed type that corresponds to the specified name and Java element type.
      Type Parameters:
      E - The element type of the represented set
      Parameters:
      name - the name of the represented attribute
      elementType - the element type of the represented attribute
      Returns:
      SetAttribute of the given name and element type
      Throws:
      IllegalArgumentException - if attribute of the given name and type is not present in the managed type
    • getDeclaredSet

      @Nonnull <E> SetAttribute<X,E> getDeclaredSet(@Nonnull String name, @Nonnull Class<E> elementType)
      Return the Set-valued attribute declared by the managed type that corresponds to the specified name and Java element type.
      Type Parameters:
      E - The element type of the represented set
      Parameters:
      name - the name of the represented attribute
      elementType - the element type of the represented attribute
      Returns:
      declared SetAttribute of the given name and element type
      Throws:
      IllegalArgumentException - if attribute of the given name and type is not declared in the managed type
    • getList

      @Nonnull <E> ListAttribute<? super X, E> getList(@Nonnull String name, @Nonnull Class<E> elementType)
      Return the List-valued attribute of the managed type that corresponds to the specified name and Java element type.
      Type Parameters:
      E - The element type of the represented list
      Parameters:
      name - the name of the represented attribute
      elementType - the element type of the represented attribute
      Returns:
      ListAttribute of the given name and element type
      Throws:
      IllegalArgumentException - if attribute of the given name and type is not present in the managed type
    • getDeclaredList

      @Nonnull <E> ListAttribute<X,E> getDeclaredList(@Nonnull String name, @Nonnull Class<E> elementType)
      Return the List-valued attribute declared by the managed type that corresponds to the specified name and Java element type.
      Type Parameters:
      E - The element type of the represented list
      Parameters:
      name - the name of the represented attribute
      elementType - the element type of the represented attribute
      Returns:
      declared ListAttribute of the given name and element type
      Throws:
      IllegalArgumentException - if attribute of the given name and type is not declared in the managed type
    • getMap

      @Nonnull <K,V> MapAttribute<? super X, K, V> getMap(@Nonnull String name, @Nonnull Class<K> keyType, @Nonnull Class<V> valueType)
      Return the Map-valued attribute of the managed type that corresponds to the specified name and Java key and value types.
      Type Parameters:
      K - The key type of the represented map
      V - The value type of the represented map
      Parameters:
      name - the name of the represented attribute
      keyType - the key type of the represented attribute
      valueType - the value type of the represented attribute
      Returns:
      MapAttribute of the given name and key and value types
      Throws:
      IllegalArgumentException - if attribute of the given name and type is not present in the managed type
    • getDeclaredMap

      @Nonnull <K,V> MapAttribute<X,K,V> getDeclaredMap(@Nonnull String name, @Nonnull Class<K> keyType, @Nonnull Class<V> valueType)
      Return the Map-valued attribute declared by the managed type that corresponds to the specified name and Java key and value types.
      Type Parameters:
      K - The key type of the represented map
      V - The value type of the represented map
      Parameters:
      name - the name of the represented attribute
      keyType - the key type of the represented attribute
      valueType - the value type of the represented attribute
      Returns:
      declared MapAttribute of the given name and key and value types
      Throws:
      IllegalArgumentException - if attribute of the given name and type is not declared in the managed type
    • getPluralAttributes

      @Nonnull Set<PluralAttribute<? super X, ?, ?>> getPluralAttributes()
      Return all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) of the managed type. Returns empty set if the managed type has no multi-valued attributes.
      Returns:
      Collection-, Set-, List-, and Map-valued attributes
    • getDeclaredPluralAttributes

      @Nonnull Set<PluralAttribute<X,?,?>> getDeclaredPluralAttributes()
      Return all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) declared by the managed type. Returns empty set if the managed type has no declared multivalued attributes.
      Returns:
      declared Collection-, Set-, List-, and Map-valued attributes
    • getAttribute

      @Nonnull Attribute<? super X, ?> getAttribute(@Nonnull String name)
      Return the attribute of the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      attribute with given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not present in the managed type
    • getDeclaredAttribute

      @Nonnull Attribute<X,?> getDeclaredAttribute(@Nonnull String name)
      Return the attribute declared by the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      attribute with given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not declared in the managed type
    • getSingularAttribute

      @Nonnull SingularAttribute<? super X, ?> getSingularAttribute(@Nonnull String name)
      Return the single-valued attribute of the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      single-valued attribute with the given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not present in the managed type
    • getDeclaredSingularAttribute

      @Nonnull SingularAttribute<X,?> getDeclaredSingularAttribute(@Nonnull String name)
      Return the single-valued attribute declared by the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      declared single-valued attribute of the given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not declared in the managed type
    • getCollection

      @Nonnull CollectionAttribute<? super X, ?> getCollection(@Nonnull String name)
      Return the Collection-valued attribute of the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      CollectionAttribute of the given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not present in the managed type
    • getDeclaredCollection

      @Nonnull CollectionAttribute<X,?> getDeclaredCollection(@Nonnull String name)
      Return the Collection-valued attribute declared by the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      declared CollectionAttribute of the given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not declared in the managed type
    • getSet

      @Nonnull SetAttribute<? super X, ?> getSet(@Nonnull String name)
      Return the Set-valued attribute of the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      SetAttribute of the given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not present in the managed type
    • getDeclaredSet

      @Nonnull SetAttribute<X,?> getDeclaredSet(@Nonnull String name)
      Return the Set-valued attribute declared by the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      declared SetAttribute of the given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not declared in the managed type
    • getList

      @Nonnull ListAttribute<? super X, ?> getList(@Nonnull String name)
      Return the List-valued attribute of the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      ListAttribute of the given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not present in the managed type
    • getDeclaredList

      @Nonnull ListAttribute<X,?> getDeclaredList(@Nonnull String name)
      Return the List-valued attribute declared by the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      declared ListAttribute of the given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not declared in the managed type
    • getMap

      @Nonnull MapAttribute<? super X, ?, ?> getMap(@Nonnull String name)
      Return the Map-valued attribute of the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      MapAttribute of the given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not present in the managed type
    • getDeclaredMap

      @Nonnull MapAttribute<X,?,?> getDeclaredMap(@Nonnull String name)
      Return the Map-valued attribute declared by the managed type that corresponds to the specified name.
      Parameters:
      name - the name of the represented attribute
      Returns:
      declared MapAttribute of the given name
      Throws:
      IllegalArgumentException - if attribute of the given name is not declared in the managed type