Class EAV


  • public class EAV
    extends Object
    EAV wrapper for the actual EAV implementation.
    • Field Detail

      • SNAPSHOT_TREE_ID

        public static final int SNAPSHOT_TREE_ID
        tree id for SparseFullHarvest attributes and types.
        See Also:
        Constant Field Values
      • DOMAIN_TREE_ID

        public static final int DOMAIN_TREE_ID
        tree id for DomainConfiguration attributes and types.
        See Also:
        Constant Field Values
      • classLoader

        protected static ClassLoader classLoader
        Classloader used to instantiate attribute type implementations.
      • instance

        protected static EAV instance
        Singleton instance.
      • db

        protected com.antiaction.raptor.sql.DBWrapper db
        DB layer implementation. MSSQL is more like SQL92.
    • Constructor Detail

      • EAV

        public EAV()
    • Method Detail

      • getInstance

        public static EAV getInstance()
        Returns:
        an instance of this class.
      • insertAttribute

        public void insertAttribute​(com.antiaction.raptor.dao.AttributeBase attribute)
        Insert attribute into database.
        Parameters:
        attribute - attribute to insert into database
      • saveAttribute

        public void saveAttribute​(com.antiaction.raptor.dao.AttributeBase attribute)
        Update existing attribute.
        Parameters:
        attribute - attribute to update in database
      • getAttributeTypes

        public List<com.antiaction.raptor.dao.AttributeTypeBase> getAttributeTypes​(int tree_id)
        Returns a list of attribute types for the given tree id.
        Parameters:
        tree_id - tree id to look for attribute types in
        Returns:
        a list of attribute types for the given tree id
      • getAttributesAndTypes

        public List<EAV.AttributeAndType> getAttributesAndTypes​(int tree_id,
                                                                int entity_id)
                                                         throws SQLException
        Returns a list of attributes and their type for a given entity id and tree id.
        Parameters:
        tree_id - tree id to look in
        entity_id - entity to look for
        Returns:
        a list of attributes and their type for a given entity id and tree id.
        Throws:
        SQLException - if an SQL exception occurs while querying the database
      • compare

        public static int compare​(List<EAV.AttributeAndType> antList1,
                                  List<EAV.AttributeAndType> antList2)
        Compare two lists containing attributes and their types.
        Parameters:
        antList1 -
        antList2 -
        Returns:
        the result of comparing two lists containing attributes and their types
      • getAttributeNames

        public static Set<String> getAttributeNames​(int tree_id)
        Get list of attribute names for a specific tree_id
        Parameters:
        tree_id - a given tree_id
        Returns:
        list of attribute names for a specific tree_id