Migrate AccountGroup owner Id to UUID

Only internal groups have an Id and future support for external groups
will only have a UUID. This change is needed because existing LDAP
groups have an Id and may be the owner of an internal group. In order to
ease the future migration, allow internal groups to be owned by a UUID.

Change-Id: I126e79667e17b2113007c1c300f5f40c0bb4f9c0
This commit is contained in:
Colby Ranger
2012-05-10 15:46:52 -07:00
parent 795167c05e
commit 60b7fbe665
11 changed files with 147 additions and 52 deletions

View File

@@ -51,7 +51,7 @@ public final class AccountGroup {
StringKey<com.google.gwtorm.client.Key<?>> {
private static final long serialVersionUID = 1L;
@Column(id = 1, length = 40)
@Column(id = 1)
protected String uuid;
protected UUID() {
@@ -193,14 +193,6 @@ public final class AccountGroup {
@Column(id = 2)
protected Id groupId;
/**
* Identity of the group whose members can manage this group.
* <p>
* This can be a self-reference to indicate the group's members manage itself.
*/
@Column(id = 3)
protected Id ownerGroupId;
/** A textual description of the group's purpose. */
@Column(id = 4, length = Integer.MAX_VALUE, notNull = false)
protected String description;
@@ -220,6 +212,14 @@ public final class AccountGroup {
@Column(id = 9)
protected UUID groupUUID;
/**
* Identity of the group whose members can manage this group.
* <p>
* This can be a self-reference to indicate the group's members manage itself.
*/
@Column(id = 10)
protected UUID ownerGroupUUID;
protected AccountGroup() {
}
@@ -227,9 +227,9 @@ public final class AccountGroup {
final AccountGroup.Id newId, final AccountGroup.UUID uuid) {
name = newName;
groupId = newId;
ownerGroupId = groupId;
visibleToAll = false;
groupUUID = uuid;
ownerGroupUUID = groupUUID;
setType(Type.INTERNAL);
}
@@ -257,12 +257,12 @@ public final class AccountGroup {
description = d;
}
public AccountGroup.Id getOwnerGroupId() {
return ownerGroupId;
public AccountGroup.UUID getOwnerGroupUUID() {
return ownerGroupUUID;
}
public void setOwnerGroupId(final AccountGroup.Id id) {
ownerGroupId = id;
public void setOwnerGroupUUID(final AccountGroup.UUID uuid) {
ownerGroupUUID = uuid;
}
public Type getType() {