Interface AttributeOptionDAO

    • Method Detail

      • deleteBySetIdAndAttribute

        boolean deleteBySetIdAndAttribute​(long setId,
                                          String attribute)
        This method deletes options.
        Parameters:
        setId - ID of the attribute set
        attribute - Name of the attribute (optional)
        Returns:
        if all went ok
      • deleteOrphaned

        void deleteOrphaned​(long setId,
                            Collection<String> currentAttributes)
        This method deletes the orphaned options of a given template
        Parameters:
        setId - ID of the attribute set
        currentAttributes - Names of the attributes of the actual template
      • findByAttribute

        List<AttributeOption> findByAttribute​(long setId,
                                              String attribute)
        This finds all the options for a given attribute. The list is ordered by position asc.
        Parameters:
        setId - The attribute set id
        attribute - The attribute name (Optional)
        Returns:
        The ordered list of options
      • findByAttributeAsMap

        Map<String,​List<AttributeOption>> findByAttributeAsMap​(long setId,
                                                                     String attribute)
        This finds all the options for a given attribute and groups them by category. The list is ordered by position asc.
        Parameters:
        setId - The attribute set id
        attribute - The attribute name
        Returns:
        The map of opions, key is the category
      • findByAttributeAndCategory

        List<AttributeOption> findByAttributeAndCategory​(long setId,
                                                         String attribute,
                                                         String category)
        This finds all the options for a given attribute. The list is ordered by position asc.
        Parameters:
        setId - The attribute set id
        attribute - The attribute name (Optional)
        caegory - The category (Optional)
        Returns:
        The ordered list of options