Skip to content

Commit

Permalink
# IGNITE-32: Fixed notes after review.
Browse files Browse the repository at this point in the history
  • Loading branch information
akuznetsov-gridgain committed Feb 4, 2015
1 parent 802f2c5 commit 9b132b7
Show file tree
Hide file tree
Showing 21 changed files with 1,195 additions and 132 deletions.
Expand Up @@ -60,28 +60,28 @@ public CacheTypeFieldMetadata(String javaName, Class<?> javaType, String dbName,
/** /**
* @return Column name in database. * @return Column name in database.
*/ */
public String getDbName() { public String getDatabaseName() {
return dbName; return dbName;
} }


/** /**
* @param dbName Column name in database. * @param dbName Column name in database.
*/ */
public void setDbName(String dbName) { public void setDatabaseName(String dbName) {
this.dbName = dbName; this.dbName = dbName;
} }


/** /**
* @return Column JDBC type in database. * @return Column JDBC type in database.
*/ */
public int getDbType() { public int getDatabaseType() {
return dbType; return dbType;
} }


/** /**
* @param dbType Column JDBC type in database. * @param dbType Column JDBC type in database.
*/ */
public void setDbType(int dbType) { public void setDatabaseType(int dbType) {
this.dbType = dbType; this.dbType = dbType;
} }


Expand Down
Expand Up @@ -18,6 +18,7 @@
package org.apache.ignite.cache; package org.apache.ignite.cache;


import org.apache.ignite.internal.util.tostring.*; import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.lang.*;


import java.util.*; import java.util.*;


Expand Down Expand Up @@ -45,6 +46,72 @@ public class CacheTypeMetadata {
@GridToStringInclude @GridToStringInclude
private Collection<CacheTypeFieldMetadata> valFields; private Collection<CacheTypeFieldMetadata> valFields;


/** Fields to be queried, in addition to indexed fields. */
@GridToStringInclude
private Map<String, Class<?>> qryFlds;

/** Fields to index in ascending order. */
@GridToStringInclude
private Map<String, Class<?>> ascFlds;

/** Fields to index in descending order. */
@GridToStringInclude
private Map<String, Class<?>> descFlds;

/** Fields to index as text. */
@GridToStringInclude
private Collection<String> txtFlds;

/** Fields to create group indexes for. */
@GridToStringInclude
private Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> grps;

/**
* Default constructor.
*/
public CacheTypeMetadata() {
keyFields = new ArrayList<>();

valFields = new ArrayList<>();

qryFlds = new LinkedHashMap<>();

ascFlds = new LinkedHashMap<>();

descFlds = new LinkedHashMap<>();

txtFlds = new LinkedHashSet<>();

grps = new LinkedHashMap<>();
}

/**
* Copy constructor.
*/
public CacheTypeMetadata(CacheTypeMetadata src) {
dbSchema = src.getDatabaseSchema();

dbTbl = src.getDatabaseTable();

keyType = getKeyType();

valType = getValueType();

keyFields = new ArrayList<>(src.getKeyFields());

valFields = new ArrayList<>(src.getValueFields());

qryFlds = new LinkedHashMap<>(src.getQueryFields());

ascFlds = new LinkedHashMap<>(src.getAscendingFields());

descFlds = new LinkedHashMap<>(src.getDescendingFields());

txtFlds = new LinkedHashSet<>(src.getTextFields());

grps = new LinkedHashMap<>(src.getGroups());
}

/** /**
* Gets database schema name. * Gets database schema name.
* *
Expand Down Expand Up @@ -99,6 +166,14 @@ public void setKeyType(String keyType) {
this.keyType = keyType; this.keyType = keyType;
} }


/**
* Sets key type.
*
* @param cls Key type class.
*/
public void setKeyType(Class<?> cls) {
setKeyType(cls.getName());
}


/** /**
* Gets value type. * Gets value type.
Expand All @@ -118,6 +193,15 @@ public void setValueType(String valType) {
this.valType = valType; this.valType = valType;
} }


/**
* Sets value type.
*
* @param cls Value type class.
*/
public void setValueType(Class<?> cls) {
setValueType(cls.getName());
}

/** /**
* Gets key fields. * Gets key fields.
* *
Expand Down Expand Up @@ -145,6 +229,96 @@ public Collection<CacheTypeFieldMetadata> getValueFields() {
return valFields; return valFields;
} }


/**
* Gets query-enabled fields.
*
* @return Collection of fields available for query.
*/
public Map<String, Class<?>> getQueryFields() {
return qryFlds;
}

/**
* Sets query fields map.
*
* @param qryFlds Query fields.
*/
public void setQueryFields(Map<String, Class<?>> qryFlds) {
this.qryFlds = qryFlds;
}

/**
* Gets ascending-indexed fields.
*
* @return Map of ascending-indexed fields.
*/
public Map<String, Class<?>> getAscendingFields() {
return ascFlds;
}

/**
* Sets ascending-indexed fields.
*
* @param ascFlds Map of ascending-indexed fields.
*/
public void setAscendingFields(Map<String, Class<?>> ascFlds) {
this.ascFlds = ascFlds;
}

/**
* Gets descending-indexed fields.
*
* @return Map of descending-indexed fields.
*/
public Map<String, Class<?>> getDescendingFields() {
return descFlds;
}

/**
* Sets descending-indexed fields.
*
* @param descFlds Map of descending-indexed fields.
*/
public void setDescendingFields(Map<String, Class<?>> descFlds) {
this.descFlds = descFlds;
}

/**
* Gets text-indexed fields.
*
* @return Collection of text indexed fields.
*/
public Collection<String> getTextFields() {
return txtFlds;
}

/**
* Sets text-indexed fields.
*
* @param txtFlds Text-indexed fields.
*/
public void setTextFields(Collection<String> txtFlds) {
this.txtFlds = txtFlds;
}

/**
* Gets group-indexed fields.
*
* @return Map of group-indexed fields.
*/
public Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> getGroups() {
return grps;
}

/**
* Sets group-indexed fields.
*
* @param grps Map of group-indexed fields from index name to index fields.
*/
public void setGroups(Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> grps) {
this.grps = grps;
}

/** /**
* Sets value fields. * Sets value fields.
* *
Expand Down

0 comments on commit 9b132b7

Please sign in to comment.