javax.persistence.metamodel

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:
    Java Persistence 2.0
    • Method Detail

      • getAttributes

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

        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

        <Y> SingularAttribute<? super X,Y> getSingularAttribute(String name,
                                                                Class<Y> type)
        Return the single-valued attribute of the managed type that corresponds to the specified name and Java type.
        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

        <Y> SingularAttribute<X,Y> getDeclaredSingularAttribute(String name,
                                                                Class<Y> type)
        Return the single-valued attribute declared by the managed type that corresponds to the specified name and Java type.
        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

        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

        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

        <E> CollectionAttribute<? super X,E> getCollection(String name,
                                                           Class<E> elementType)
        Return the Collection-valued attribute of the managed type that corresponds to the specified name and Java element type.
        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

        <E> CollectionAttribute<X,E> getDeclaredCollection(String name,
                                                           Class<E> elementType)
        Return the Collection-valued attribute declared by the managed type that corresponds to the specified name and Java element type.
        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

        <E> SetAttribute<? super X,E> getSet(String name,
                                             Class<E> elementType)
        Return the Set-valued attribute of the managed type that corresponds to the specified name and Java element type.
        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

        <E> SetAttribute<X,E> getDeclaredSet(String name,
                                             Class<E> elementType)
        Return the Set-valued attribute declared by the managed type that corresponds to the specified name and Java element type.
        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

        <E> ListAttribute<? super X,E> getList(String name,
                                               Class<E> elementType)
        Return the List-valued attribute of the managed type that corresponds to the specified name and Java element type.
        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

        <E> ListAttribute<X,E> getDeclaredList(String name,
                                               Class<E> elementType)
        Return the List-valued attribute declared by the managed type that corresponds to the specified name and Java element type.
        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

        <K,V> MapAttribute<? super X,K,V> getMap(String name,
                                                 Class<K> keyType,
                                                 Class<V> valueType)
        Return the Map-valued attribute of the managed type that corresponds to the specified name and Java key and value types.
        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

        <K,V> MapAttribute<X,K,V> getDeclaredMap(String name,
                                                 Class<K> keyType,
                                                 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.
        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

        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

        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 multi-valued attributes.
        Returns:
        declared Collection-, Set-, List-, and Map-valued attributes
      • getAttribute

        Attribute<? super X,?> getAttribute(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

        Attribute<X,?> getDeclaredAttribute(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

        SingularAttribute<? super X,?> getSingularAttribute(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

        SingularAttribute<X,?> getDeclaredSingularAttribute(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

        CollectionAttribute<? super X,?> getCollection(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

        CollectionAttribute<X,?> getDeclaredCollection(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

        SetAttribute<? super X,?> getSet(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

        SetAttribute<X,?> getDeclaredSet(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

        ListAttribute<? super X,?> getList(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

        ListAttribute<X,?> getDeclaredList(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

        MapAttribute<? super X,?,?> getMap(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

        MapAttribute<X,?,?> getDeclaredMap(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

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/persistence/metamodel/managedtype.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.