Class MetadataTagDao


  • public class MetadataTagDao
    extends AbstractDao
    Provides a DAO for the MetadataTag entity.
    See Also:
    MetadataTag
    • Constructor Detail

      • MetadataTagDao

        public MetadataTagDao()
    • Method Detail

      • getMetadataTag

        public MetadataTag getMetadataTag​(String tagId)
        Return the metadata tag with the specified OID
        Parameters:
        tagId - the OID
        Returns:
        the matching metadata tag, or null if not found
      • createMetadataTag

        public MetadataTag createMetadataTag()
        Create a metadata tag and register it with the data context
        Returns:
        the new metadata tag
      • getMetadataTagList

        public List<MetadataTag> getMetadataTagList​(String clientId,
                                                    String keyword,
                                                    String scope)
        Return the list of metadata tags matching the specified search criteria, sorted by name
        Parameters:
        clientId - the OID of the client associated with the metadata tag (optional); note that global metadata tags are always included
        keyword - the search keyword
        scope - the the metadata scope (optional)
        Returns:
        the list of matching metadata tags
      • hasMetadataTags

        public boolean hasMetadataTags​(Client client)
        Return true if the client has metadata tags.
        Parameters:
        client - the client organization
        Returns:
        true if the client has tags
        Since:
        5.1.4
      • getMetadataTagListForClient

        public List<MetadataTag> getMetadataTagListForClient​(Client client)
        Return the list of metadata tags who are associated with a specific client, sorted by name (global metadata tags are not included)
        Parameters:
        client - the client
        Returns:
        the list of metadata tags
      • getRequiredMetadataTagListForClient

        public List<MetadataTag> getRequiredMetadataTagListForClient​(Client client)
        Return the list of required metadata tags who are associated with a specific client as well as global tags, sorted by name
        Parameters:
        client - the client (optional)
        Returns:
        the list of required metadata tags
      • getTagByName

        public MetadataTag getTagByName​(String name,
                                        Client client)
        Return the metadata tag for the specified name and client
        Parameters:
        name - the tag name
        client - the client, or null if looking for a global tag
        Returns:
        the matching tag, if one exists
      • getTagQueryForClient

        public org.apache.cayenne.query.SelectQuery getTagQueryForClient​(String scope,
                                                                         String clientOid)
        Return a query that will return metadata tags assignable to a client and belonging to a certain scope (client, form). If no client is specified, only global metadata tags are returned.
        Parameters:
        scope - the scope (optional)
        clientOid - the OID of the client (optional)
        Returns:
        a SelectQuery