Hi again!
I've realised that I cannot use a different index name. If my *class *is
*A3User* my index name must be *A3User.id* it can't have a different name
as (A3UserIdx), beacuse the internal funcion uses the dot as a separator to
obtain the classname and then call de DB to get that class.
There are other ways to do this?
Thanks in advanced!
Gerard.
El divendres 18 de juliol de 2014 16:39:45 UTC+2, Gerard Solé va escriure:
>
> Hi,
>
> I'm trying to index some properties of a subclass of a Vertex (from now,
> A3User). To create the index I call the following methods:
>
> user.createIndex("A3UserIdx.id", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX,
> User.ID);
>
> user.createIndex("A3UserIdx.email", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX,
> User.EMAIL);
>
>
> Basically, I set has UNIQUE the ID and EMAIL of a user. I saw that passing
> multiple properties on a unique type index requires that all of that
> properties need to be unique at the same time, so repeating an id or an
> email, but not both of them it's count as Unique.
>
> Then, I want to retrieve a node from that index, and as I know that the ID
> or the EMAIL will be unique, I want to call the index to give me a single
> A3User or at least a list of A3Users which should only be one object.
>
> To call this Index I'm trying to use two different functions, both of them
> return null, and I'm not finding any solution to this problem, so I don't
> know exactly what I'm doing it wrong. (In OrientDB studio the index seems
> to be properly created). In studio it is written as:
>
> <http://i.imgur.com/LGhcxfj.png>
>
> Methods that return null:
>
> String *idxProp *= userId.contains("@")? "A3UserIdx.id"
> : "A3UserIdx.email";
>
> Index<Vertex> idxV = graph.getIndex(*idxProp*, Vertex.class);
>
> graph.getVertices(*idxProp*, userId)
>
>
>
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.