Hi,
I'm using an entity with DocumentProperties....
@Entity
@SpaceClass
public class Entity implements Externalizable {
String id;
DocumentProperties properties = new DocumentProperties();
@Id
@Column(name="id", unique=true)
@SpaceId(autoGenerate=false)
public String getId() {
return id;
}
public void setId(String id){
this.id = id;
}
@SpaceDynamicProperties
public DocumentProperties getProperties() {
return properties;
}
.........
}
I want to query the entity using some of the atributes within the DocumentProperties using a SQLQuery:
final SQLQuery sqlQuery = new SQLQuery<>(
Entity.class, "data1 = ? AND data2 = ?",
"ABC", "123");
Entity[] resp = gigaSpace.readMultiple(sqlQuery, 10, ReadModifiers.READ_COMMITED));
How can I define a compound index over the data1 and data2 properties????
I try to add using the property name directly in the path like this:
@Entity
@SpaceClass
@CompoundSpaceIndexes({ @CompoundSpaceIndex(paths = {"data1", "data2"}) })
public class Entity implements Externalizable {
Using this, the SQLQuery and space queries starts to fail and never find any object (Always return an empty array).
If I add the docuement properties attribute to the path, it starts working again but i'm not sure if the indexes are used or even created:
@Entity
@SpaceClass
@CompoundSpaceIndexes({ @CompoundSpaceIndex(paths = {"properties.data1", "properties.data2"}) })
public class Entity implements Externalizable {
How I must define the compound indexes? How can i check if the indexes are created correctly and are actually being used?
Im using GigaSpaces XAP 10.2.1 With Java 8
Thanks,
Manuel Vieda
↧