|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.websphere.objectgrid.config.QueryMapping
public class QueryMapping
A QueryMapping maps a Java class to a BackingMap and allows a map to be included in a query. It also indicates whether the query engine should use a getter method or direct field access to access fields in the value class.
For example, class Department is the value class that is stored in the "DepartmentMap" BackingMap and the key is an Integer.
public class Department { private int id; private Collection emps; public void setEmps(Collection emps) { this.emps = emps; } public Collection getEmps() { return emps; } ... }The QueryMapping would be created as follows:
... QueryConfig queryConfig = new QueryConfig(); queryConfig.addMapping(new QueryMapping( "DepartmentMap", Department.class.getName(), "id", QueryMapping.PROPERTY_ACCESS) objectGrid.setQueryConfig(queryConfig); ...
Field Summary | |
---|---|
static int |
FIELD_ACCESS
This constant indicates to use direct field access to read the field values |
static int |
PROPERTY_ACCESS
This constant indicates to use JavaBean property-style get methods to read the field values from the Java object stored in the BackingMap. |
Constructor Summary | |
---|---|
QueryMapping()
Default constructor. |
|
QueryMapping(String mapName,
String valueClass,
String primaryKeyField)
Constructor for creating a basic QueryMapping instance with a default access type of PROPERTY_ACCESS . |
|
QueryMapping(String mapName,
String valueClass,
String primaryKeyField,
int accessType)
Constructor for creating a QueryMapping instance. |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
int |
getAccessType()
Retrieve the method in which the query engine will access the value class object stored in the BackingMap. |
String |
getMapName()
Retrieve the BackingMap name associated with this mapping. |
String |
getPrimaryKeyField()
Retrieve the name of the attribute in the value class object that is also the primary key of the BackingMap. |
String |
getValueClass()
Retrieve the type of object that is stored in the BackingMap. |
int |
hashCode()
|
void |
setAccessType(int accessType)
Set the method in which the query engine will access the value class object stored in the BackingMap. |
void |
setMapName(String mapName)
Set the BackingMap name associated with this mapping. |
void |
setPrimaryKeyField(String primaryKeyField)
Set the name of the attribute in the value class object that is also the primary key of the BackingMap. |
void |
setValueClass(String valueClass)
Set the type of object that is stored in the BackingMap. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int FIELD_ACCESS
setAccessType(int)
,
getAccessType()
,
Constant Field Valuespublic static final int PROPERTY_ACCESS
setAccessType(int)
,
getAccessType()
,
Constant Field ValuesConstructor Detail |
---|
public QueryMapping()
public QueryMapping(String mapName, String valueClass, String primaryKeyField)
PROPERTY_ACCESS
.The mapName and valueClass must not be null.
mapName
- the name of the BackingMap to mapvalueClass
- the class of object stored in the BackingMap's value.primaryKeyField
- the optional name of the primary key field of the class.public QueryMapping(String mapName, String valueClass, String primaryKeyField, int accessType)
mapName
- the name of the BackingMap to mapvalueClass
- the class of object stored in the BackingMap's value.primaryKeyField
- the optional name of the primary key field of the class.accessType
- the method (PROPERTY_ACCESS
or FIELD_ACCESS
)
in which the query engine will access the persistent data in the value object.Method Detail |
---|
public String getMapName()
public void setMapName(String mapName)
public String getValueClass()
public void setValueClass(String valueClass)
public int getAccessType()
PROPERTY_ACCESS
,
FIELD_ACCESS
public void setAccessType(int accessType)
accessType
- the accessType.PROPERTY_ACCESS
,
FIELD_ACCESS
public String getPrimaryKeyField()
This value is optional.
public void setPrimaryKeyField(String primaryKeyField)
primaryKeyField
- the name of the primary key attribute or null if not set.public boolean equals(Object o)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public String toString()
toString
in class Object
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |