Home » Support » Forum » Problem with Composite indices

Problem with Composite indices

#1

Hi,

I want to realize the following: I have 2 classes, one Client class which looks like:

public class Client
{
    @Index (unique = "true")
    private String name;
}

and a User class which looks like:

@Index (members = {"client", "emails"})
public class User
{
    private Client client;
    private List<String> emails;
}

So I want to be sure that each User which belongs to one Client has an unique Email address but only in relation to a specific Client (e.g. Client "a"->User "d@web.de", Client "b"->User "d@web.de").

No I get the exception: Invalid index path 'emails' in type User

How can I realize such constraint?

Kind regards
Markus

#2

This uniqueness constraint has to be enforced by the application.

Unfortunately a composite index on a field + a collection is not allowed.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

Ok. Thanks


Post Reply

To post a reply and/or subscribe to update notifications - please login