mirror of
https://github.com/google/nomulus.git
synced 2025-07-24 19:48:32 +02:00
Add indexes on contacts in the Domain table (#1145)
These indexes are used to find if a contact is linked to a domain in during a contact delete. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/google/nomulus/1145) <!-- Reviewable:end -->
This commit is contained in:
parent
f3a5a5aebd
commit
8cfefcef6e
8 changed files with 4029 additions and 3919 deletions
|
@ -405,15 +405,18 @@ public final class EppResourceUtils {
|
|||
.setParameter("fkRepoId", key.getSqlKey())
|
||||
.setParameter("now", now.toDate());
|
||||
}
|
||||
return (ImmutableSet<VKey<DomainBase>>)
|
||||
query
|
||||
.setMaxResults(limit)
|
||||
.getResultStream()
|
||||
.map(
|
||||
repoId ->
|
||||
DomainBase.createVKey(
|
||||
Key.create(DomainBase.class, (String) repoId)))
|
||||
.collect(toImmutableSet());
|
||||
@SuppressWarnings("unchecked")
|
||||
ImmutableSet<VKey<DomainBase>> domainBaseKeySet =
|
||||
(ImmutableSet<VKey<DomainBase>>)
|
||||
query
|
||||
.setMaxResults(limit)
|
||||
.getResultStream()
|
||||
.map(
|
||||
repoId ->
|
||||
DomainBase.createVKey(
|
||||
Key.create(DomainBase.class, (String) repoId)))
|
||||
.collect(toImmutableSet());
|
||||
return domainBaseKeySet;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,12 +54,16 @@ import org.joda.time.DateTime;
|
|||
@Table(
|
||||
name = "Domain",
|
||||
indexes = {
|
||||
@Index(columnList = "adminContact"),
|
||||
@Index(columnList = "autorenewEndTime"),
|
||||
@Index(columnList = "billingContact"),
|
||||
@Index(columnList = "creationTime"),
|
||||
@Index(columnList = "currentSponsorRegistrarId"),
|
||||
@Index(columnList = "deletionTime"),
|
||||
@Index(columnList = "domainName"),
|
||||
@Index(columnList = "techContact"),
|
||||
@Index(columnList = "tld"),
|
||||
@Index(columnList = "autorenewEndTime")
|
||||
@Index(columnList = "registrantContact")
|
||||
})
|
||||
@WithStringVKey
|
||||
@ExternalMessagingName("domain")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue