mirror of
https://github.com/google/nomulus.git
synced 2025-07-05 10:43:26 +02:00
Add unique constraints on domain_hosts (#911)
* Add unique constraints on domain_hosts Add unique constraints on DomainHost (child of DomainBase) and DomainHistoryHost (child of DomainHistory). DomainHost is non-entity embedded object and Hibernate does not define indexes automatically. This should improve read and write performance of the parent entities.
This commit is contained in:
parent
2cf190e448
commit
cb63c3dd80
8 changed files with 174 additions and 55 deletions
|
@ -75,7 +75,9 @@ public class DomainBase extends DomainContent
|
|||
}
|
||||
|
||||
@ElementCollection
|
||||
@JoinTable(name = "DomainHost")
|
||||
@JoinTable(
|
||||
name = "DomainHost",
|
||||
indexes = {@Index(columnList = "domain_repo_id,host_repo_id", unique = true)})
|
||||
@Access(AccessType.PROPERTY)
|
||||
@Column(name = "host_repo_id")
|
||||
public Set<VKey<HostResource>> getNsHosts() {
|
||||
|
|
|
@ -96,7 +96,14 @@ public class DomainHistory extends HistoryEntry implements SqlEntity {
|
|||
// TODO(b/166776754): Investigate if we can reuse domainContent.nsHosts for storing host keys.
|
||||
@Ignore
|
||||
@ElementCollection
|
||||
@JoinTable(name = "DomainHistoryHost")
|
||||
@JoinTable(
|
||||
name = "DomainHistoryHost",
|
||||
indexes = {
|
||||
@Index(
|
||||
columnList =
|
||||
"domain_history_history_revision_id,domain_history_domain_repo_id,host_repo_id",
|
||||
unique = true),
|
||||
})
|
||||
@Column(name = "host_repo_id")
|
||||
Set<VKey<HostResource>> nsHosts;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue