Class EAV
- java.lang.Object
-
- dk.netarkivet.harvester.datamodel.eav.EAV
-
public class EAV extends Object
EAV wrapper for the actual EAV implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EAV.AttributeAndType
Handy class to pair an attribute and its type.
-
Field Summary
Fields Modifier and Type Field Description protected static ClassLoader
classLoader
Classloader used to instantiate attribute type implementations.protected com.antiaction.raptor.sql.DBWrapper
db
DB layer implementation.static int
DOMAIN_TREE_ID
tree id forDomainConfiguration
attributes and types.protected static EAV
instance
Singleton instance.static int
SNAPSHOT_TREE_ID
tree id forSparseFullHarvest
attributes and types.
-
Constructor Summary
Constructors Constructor Description EAV()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
compare(List<EAV.AttributeAndType> antList1, List<EAV.AttributeAndType> antList2)
Compare two lists containing attributes and their types.static Set<String>
getAttributeNames(int tree_id)
Get list of attribute names for a specific tree_idList<EAV.AttributeAndType>
getAttributesAndTypes(int tree_id, int entity_id)
Returns a list of attributes and their type for a given entity id and tree id.List<com.antiaction.raptor.dao.AttributeTypeBase>
getAttributeTypes(int tree_id)
Returns a list of attribute types for the given tree id.static EAV
getInstance()
void
insertAttribute(com.antiaction.raptor.dao.AttributeBase attribute)
Insert attribute into database.void
saveAttribute(com.antiaction.raptor.dao.AttributeBase attribute)
Update existing attribute.
-
-
-
Field Detail
-
SNAPSHOT_TREE_ID
public static final int SNAPSHOT_TREE_ID
tree id forSparseFullHarvest
attributes and types.- See Also:
- Constant Field Values
-
DOMAIN_TREE_ID
public static final int DOMAIN_TREE_ID
tree id forDomainConfiguration
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.
-
-
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 inentity_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
-
-