ObjectDB ObjectDB

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

edit
delete
#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
edit
delete
#3

Ok. Thanks

edit
delete

Reply

To post on this website please sign in.