Switch over to non-ReferenceUnion fields on DomainBase

This is the second phase of a three phase migration to remove
ReferenceUnions. As of the end of this phase, ReferenceUnions are no longer read
from in any active code paths, but are still written to in case a rollback to
the previous version is necessary. The third and final phase will remove the
ReferenceUnions entirely.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137951076
This commit is contained in:
mcilwain 2016-11-02 08:55:46 -07:00 committed by Ben McIlwain
parent 59d998954c
commit f95f27ed72
6 changed files with 25 additions and 34 deletions

View file

@ -347,12 +347,10 @@ public final class EppResourceUtils {
public static List<Key<DomainBase>> queryDomainsUsingResource(
Class<? extends EppResource> clazz, Key<? extends EppResource> key, DateTime now, int limit) {
checkArgument(ContactResource.class.equals(clazz) || HostResource.class.equals(clazz));
return ofy().load().type(DomainBase.class)
.filter(
clazz.equals(ContactResource.class)
? "allContacts.contactId.linked"
: "nameservers.linked",
key)
return ofy()
.load()
.type(DomainBase.class)
.filter(clazz.equals(ContactResource.class) ? "allContacts.contact" : "nsHosts", key)
.filter("deletionTime >", now)
.limit(limit)
.keys()