Temporarily revert phase two of migration away from ReferenceUnions

*** Reason for rollback ***

This code is fine, and I will be resurrecting it unaltered next week.  It's only being rolled back for operational reasons related to the timing of our internal pushes.

*** Original change description ***

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=136642759
This commit is contained in:
mcilwain 2016-10-19 14:30:38 -07:00 committed by Ben McIlwain
parent 0f8e398c00
commit 0b4c3e56d6
6 changed files with 34 additions and 25 deletions

View file

@ -347,10 +347,12 @@ 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.contact" : "nsHosts", key)
return ofy().load().type(DomainBase.class)
.filter(
clazz.equals(ContactResource.class)
? "allContacts.contactId.linked"
: "nameservers.linked",
key)
.filter("deletionTime >", now)
.limit(limit)
.keys()