Search in sources :

Example 1 with Index

use of com.infiniteautomation.mango.db.query.Index in project ma-core-public by infiniteautomation.

the class DataPointDao method getIndexes.

/* (non-Javadoc)
     * @see com.serotonin.m2m2.db.dao.AbstractBasicDao#getIndexes()
     */
@Override
protected List<Index> getIndexes() {
    List<Index> indexes = new ArrayList<Index>();
    List<QueryAttribute> columns = new ArrayList<QueryAttribute>();
    // Data Source Name Force
    columns.add(new QueryAttribute("name", new HashSet<String>(), Types.VARCHAR));
    indexes.add(new Index("nameIndex", "ds", columns, "ASC"));
    // Data Source xid Force
    columns = new ArrayList<QueryAttribute>();
    columns.add(new QueryAttribute("xid", new HashSet<String>(), Types.VARCHAR));
    indexes.add(new Index("dataSourcesUn1", "ds", columns, "ASC"));
    // DeviceNameName Index Force
    columns = new ArrayList<QueryAttribute>();
    columns.add(new QueryAttribute("deviceName", new HashSet<String>(), Types.VARCHAR));
    columns.add(new QueryAttribute("name", new HashSet<String>(), Types.VARCHAR));
    indexes.add(new Index("deviceNameNameIndex", "dp", columns, "ASC"));
    // xid point name force
    columns = new ArrayList<QueryAttribute>();
    columns.add(new QueryAttribute("xid", new HashSet<String>(), Types.VARCHAR));
    columns.add(new QueryAttribute("name", new HashSet<String>(), Types.VARCHAR));
    indexes.add(new Index("xidNameIndex", "dp", columns, "ASC"));
    return indexes;
}
Also used : ArrayList(java.util.ArrayList) QueryAttribute(com.infiniteautomation.mango.db.query.QueryAttribute) Index(com.infiniteautomation.mango.db.query.Index) HashSet(java.util.HashSet)

Aggregations

Index (com.infiniteautomation.mango.db.query.Index)1 QueryAttribute (com.infiniteautomation.mango.db.query.QueryAttribute)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1