Remove @SecondaryKey from AccountGroup

Like our prior changes, we need to drop these @SecondaryKey
annotations for databases which don't support multiple keys
on a single entity.

For the external name attribute we simply change it to honor
a list of groups which match the external name.  This allows
an administrator to create multiple groups in Gerrit that use
the same underlying LDAP group for membership.  Its crazy to
do, but there isn't really any good reason to not allow it.

For the internal name attribute we create a new entity that
can be used to enforce uniqueness on the name attribute, and
connects the name to the group.

Change-Id: I933c38a6a4e2c3ed3d7d5a66cab04c2e7175e24f
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-12-31 10:26:26 -08:00
parent b80f07dd5e
commit b1dac0a73b
18 changed files with 379 additions and 87 deletions

View File

@@ -42,7 +42,7 @@ public class AccountGroupIdHandler extends OptionHandler<AccountGroup.Id> {
public final int parseArguments(final Parameters params)
throws CmdLineException {
final String n = params.getParameter(0);
final AccountGroup group = groupCache.lookup(n);
final AccountGroup group = groupCache.get(new AccountGroup.NameKey(n));
if (group == null) {
throw new CmdLineException(owner, "Group \"" + n + "\" does not exist");
}