Class HibernateAttributeOptionDAO

    • Constructor Detail

      • HibernateAttributeOptionDAO

        public HibernateAttributeOptionDAO()
    • Method Detail

      • deleteBySetIdAndAttribute

        public boolean deleteBySetIdAndAttribute​(long setId,
                                                 String attribute)
        Description copied from interface: AttributeOptionDAO
        This method deletes options.
        Specified by:
        deleteBySetIdAndAttribute in interface AttributeOptionDAO
        Parameters:
        setId - ID of the attribute set
        attribute - Name of the attribute (optional)
        Returns:
        if all went ok
      • findByAttribute

        public List<AttributeOption> findByAttribute​(long setId,
                                                     String attribute)
        Description copied from interface: AttributeOptionDAO
        This finds all the options for a given attribute. The list is ordered by position asc.
        Specified by:
        findByAttribute in interface AttributeOptionDAO
        Parameters:
        setId - The attribute set id
        attribute - The attribute name (Optional)
        Returns:
        The ordered list of options
      • findByAttributeAndCategory

        public List<AttributeOption> findByAttributeAndCategory​(long setId,
                                                                String attribute,
                                                                String category)
        Description copied from interface: AttributeOptionDAO
        This finds all the options for a given attribute. The list is ordered by position asc.
        Specified by:
        findByAttributeAndCategory in interface AttributeOptionDAO
        Parameters:
        setId - The attribute set id
        attribute - The attribute name (Optional)
        Returns:
        The ordered list of options
      • findByAttributeAsMap

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

        public void deleteOrphaned​(long setId,
                                   Collection<String> currentAttributes)
        Description copied from interface: AttributeOptionDAO
        This method deletes the orphaned options of a given template
        Specified by:
        deleteOrphaned in interface AttributeOptionDAO
        Parameters:
        setId - ID of the attribute set
        currentAttributes - Names of the attributes of the actual template