Search in sources :

Example 21 with AttributeReference

use of com.torodb.core.language.AttributeReference in project torodb by torodb.

the class ToroIndexConverter method parseAttRef.

private AttributeReference parseAttRef(String key) {
    //TODO: check attributes with '\.' characters
    //TODO: Check attributes references with array keys
    StringTokenizer tk = new StringTokenizer(key, ".");
    AttributeReference.Builder attRefBuilder = new AttributeReference.Builder();
    while (tk.hasMoreTokens()) {
        attRefBuilder.addObjectKey(tk.nextToken());
    }
    return attRefBuilder.build();
}
Also used : StringTokenizer(java.util.StringTokenizer) AttributeReference(com.torodb.core.language.AttributeReference) JsonArrayBuilder(javax.json.JsonArrayBuilder) JsonObjectBuilder(javax.json.JsonObjectBuilder)

Aggregations

AttributeReference (com.torodb.core.language.AttributeReference)21 IndexFieldInfo (com.torodb.torod.IndexFieldInfo)6 UserException (com.torodb.core.exceptions.user.UserException)5 ObjectKey (com.torodb.core.language.AttributeReference.ObjectKey)5 UpdateException (com.torodb.core.exceptions.user.UpdateException)4 FieldIndexOrdering (com.torodb.core.transaction.metainf.FieldIndexOrdering)4 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 CommandFailed (com.eightkdata.mongowp.exceptions.CommandFailed)2 ImmutableList (com.google.common.collect.ImmutableList)2 UnsupportedCompoundIndexException (com.torodb.core.exceptions.user.UnsupportedCompoundIndexException)2 UnsupportedUniqueIndexException (com.torodb.core.exceptions.user.UnsupportedUniqueIndexException)2 KvDocument (com.torodb.kvdocument.values.KvDocument)2 KvNumeric (com.torodb.kvdocument.values.KvNumeric)2 IndexOptions (com.torodb.mongodb.commands.pojos.index.IndexOptions)2 AscIndexType (com.torodb.mongodb.commands.pojos.index.type.AscIndexType)2 DescIndexType (com.torodb.mongodb.commands.pojos.index.type.DescIndexType)2 IndexType (com.torodb.mongodb.commands.pojos.index.type.IndexType)2 CreateIndexesResult (com.torodb.mongodb.commands.signatures.admin.CreateIndexesCommand.CreateIndexesResult)2 JsonArrayBuilder (javax.json.JsonArrayBuilder)2