diff --git a/core/src/main/java/google/registry/model/EppResource.java b/core/src/main/java/google/registry/model/EppResource.java index 411642cfc..a2de5cf71 100644 --- a/core/src/main/java/google/registry/model/EppResource.java +++ b/core/src/main/java/google/registry/model/EppResource.java @@ -140,6 +140,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable { DateTime lastEppUpdateTime; /** Status values associated with this resource. */ + @Ignore @Column(name = "statuses") // TODO(b/177567432): rename to "statuses" once we're off datastore. Set status; diff --git a/core/src/main/java/google/registry/model/common/TimeOfYear.java b/core/src/main/java/google/registry/model/common/TimeOfYear.java index f6663cdef..23e115ca8 100644 --- a/core/src/main/java/google/registry/model/common/TimeOfYear.java +++ b/core/src/main/java/google/registry/model/common/TimeOfYear.java @@ -25,7 +25,6 @@ import static org.joda.time.DateTimeZone.UTC; import com.google.common.base.Splitter; import com.google.common.collect.ContiguousSet; import com.google.common.collect.Range; -import com.googlecode.objectify.annotation.Embed; import com.googlecode.objectify.annotation.Index; import google.registry.model.ImmutableObject; import google.registry.model.UnsafeSerializable; @@ -44,7 +43,6 @@ import org.joda.time.DateTime; * allows it to be embeddable with no translation needed and also delays parsing of the string on * load until it's actually needed. */ -@Embed @Embeddable public class TimeOfYear extends ImmutableObject implements UnsafeSerializable { diff --git a/core/src/main/java/google/registry/model/contact/ContactAuthInfo.java b/core/src/main/java/google/registry/model/contact/ContactAuthInfo.java index 56c4d02d6..e037824bf 100644 --- a/core/src/main/java/google/registry/model/contact/ContactAuthInfo.java +++ b/core/src/main/java/google/registry/model/contact/ContactAuthInfo.java @@ -14,13 +14,12 @@ package google.registry.model.contact; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.eppcommon.AuthInfo; +import javax.persistence.Embeddable; import javax.xml.bind.annotation.XmlType; /** A version of authInfo specifically for contacts. */ -@Embed -@javax.persistence.Embeddable +@Embeddable @XmlType(namespace = "urn:ietf:params:xml:ns:contact-1.0") public class ContactAuthInfo extends AuthInfo { public static ContactAuthInfo create(PasswordAuth pw) { diff --git a/core/src/main/java/google/registry/model/contact/ContactBase.java b/core/src/main/java/google/registry/model/contact/ContactBase.java index 031f1f655..cfee5fc12 100644 --- a/core/src/main/java/google/registry/model/contact/ContactBase.java +++ b/core/src/main/java/google/registry/model/contact/ContactBase.java @@ -129,7 +129,7 @@ public class ContactBase extends EppResource implements ResourceWithTransferData @Index String searchName; /** Contact’s voice number. Personal info; cleared by {@link Contact.Builder#wipeOut}. */ - @IgnoreSave(IfNull.class) + @Ignore @Embedded @AttributeOverrides({ @AttributeOverride(name = "phoneNumber", column = @Column(name = "voice_phone_number")), @@ -138,7 +138,7 @@ public class ContactBase extends EppResource implements ResourceWithTransferData ContactPhoneNumber voice; /** Contact’s fax number. Personal info; cleared by {@link Contact.Builder#wipeOut}. */ - @IgnoreSave(IfNull.class) + @Ignore @Embedded @AttributeOverrides({ @AttributeOverride(name = "phoneNumber", column = @Column(name = "fax_phone_number")), @@ -151,6 +151,7 @@ public class ContactBase extends EppResource implements ResourceWithTransferData String email; /** Authorization info (aka transfer secret) of the contact. */ + @Ignore @Embedded @AttributeOverrides({ @AttributeOverride(name = "pw.value", column = @Column(name = "auth_info_value")), @@ -159,7 +160,7 @@ public class ContactBase extends EppResource implements ResourceWithTransferData ContactAuthInfo authInfo; /** Data about any pending or past transfers on this contact. */ - ContactTransferData transferData; + @Ignore ContactTransferData transferData; /** * The time that this resource was last transferred. @@ -172,6 +173,7 @@ public class ContactBase extends EppResource implements ResourceWithTransferData // the wipeOut() function, so that data is not kept around for deleted contacts. /** Disclosure policy. */ + @Ignore @Embedded @AttributeOverrides({ @AttributeOverride(name = "name", column = @Column(name = "disclose_types_name")), diff --git a/core/src/main/java/google/registry/model/contact/ContactPhoneNumber.java b/core/src/main/java/google/registry/model/contact/ContactPhoneNumber.java index 2d2571bc3..039c84478 100644 --- a/core/src/main/java/google/registry/model/contact/ContactPhoneNumber.java +++ b/core/src/main/java/google/registry/model/contact/ContactPhoneNumber.java @@ -14,7 +14,6 @@ package google.registry.model.contact; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.eppcommon.PhoneNumber; import javax.persistence.Embeddable; @@ -27,7 +26,6 @@ import javax.persistence.Embeddable; * * @see Contact */ -@Embed @Embeddable public class ContactPhoneNumber extends PhoneNumber { diff --git a/core/src/main/java/google/registry/model/contact/Disclose.java b/core/src/main/java/google/registry/model/contact/Disclose.java index 2e96eb453..0f04d29b8 100644 --- a/core/src/main/java/google/registry/model/contact/Disclose.java +++ b/core/src/main/java/google/registry/model/contact/Disclose.java @@ -17,7 +17,6 @@ package google.registry.model.contact; import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy; import com.google.common.collect.ImmutableList; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.Buildable; import google.registry.model.ImmutableObject; import google.registry.model.UnsafeSerializable; @@ -30,7 +29,6 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** The "discloseType" from RFC5733. */ -@Embed @Embeddable @XmlType(propOrder = {"name", "org", "addr", "voice", "fax", "email"}) public class Disclose extends ImmutableObject implements UnsafeSerializable { @@ -79,7 +77,6 @@ public class Disclose extends ImmutableObject implements UnsafeSerializable { } /** The "intLocType" from RFC5733. */ - @Embed public static class PostalInfoChoice extends ImmutableObject implements Serializable { @XmlAttribute PostalInfo.Type type; diff --git a/core/src/main/java/google/registry/model/domain/DesignatedContact.java b/core/src/main/java/google/registry/model/domain/DesignatedContact.java index 6c2fbaca3..5b5135c2b 100644 --- a/core/src/main/java/google/registry/model/domain/DesignatedContact.java +++ b/core/src/main/java/google/registry/model/domain/DesignatedContact.java @@ -17,7 +17,6 @@ package google.registry.model.domain; import static google.registry.util.PreconditionsUtils.checkArgumentNotNull; import com.googlecode.objectify.Key; -import com.googlecode.objectify.annotation.Embed; import com.googlecode.objectify.annotation.Ignore; import com.googlecode.objectify.annotation.Index; import google.registry.model.ImmutableObject; @@ -45,7 +44,6 @@ import javax.xml.bind.annotation.XmlEnumValue; * @see RFC 5731 - EPP Domain Name Mapping * - Contact and Client Identifiers */ -@Embed @Embeddable public class DesignatedContact extends ImmutableObject implements UnsafeSerializable { diff --git a/core/src/main/java/google/registry/model/domain/DomainAuthInfo.java b/core/src/main/java/google/registry/model/domain/DomainAuthInfo.java index 3d097cbdb..3ae9d8e25 100644 --- a/core/src/main/java/google/registry/model/domain/DomainAuthInfo.java +++ b/core/src/main/java/google/registry/model/domain/DomainAuthInfo.java @@ -14,12 +14,11 @@ package google.registry.model.domain; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.eppcommon.AuthInfo; +import javax.persistence.Embeddable; /** A version of authInfo specifically for domains. */ -@Embed -@javax.persistence.Embeddable +@Embeddable public class DomainAuthInfo extends AuthInfo { public static DomainAuthInfo create(PasswordAuth pw) { DomainAuthInfo instance = new DomainAuthInfo(); diff --git a/core/src/main/java/google/registry/model/domain/DomainBase.java b/core/src/main/java/google/registry/model/domain/DomainBase.java index 027263623..56d7ec172 100644 --- a/core/src/main/java/google/registry/model/domain/DomainBase.java +++ b/core/src/main/java/google/registry/model/domain/DomainBase.java @@ -136,6 +136,7 @@ public class DomainBase extends EppResource VKey registrantContact; /** Authorization info (aka transfer secret) of the domain. */ + @Ignore @Embedded @AttributeOverrides({ @AttributeOverride(name = "pw.value", column = @Column(name = "auth_info_value")), @@ -144,13 +145,14 @@ public class DomainBase extends EppResource DomainAuthInfo authInfo; /** Data used to construct DS records for this domain. */ - @Transient Set dsData; + @Ignore @Transient Set dsData; /** * The claims notice supplied when this domain was created, if there was one. * *

It's {@literal @}XmlTransient because it's not returned in an info response. */ + @Ignore @Embedded @AttributeOverrides({ @AttributeOverride(name = "noticeId.tcnId", column = @Column(name = "launch_notice_tcn_id")), @@ -214,7 +216,7 @@ public class DomainBase extends EppResource VKey autorenewPollMessage; /** The unexpired grace periods for this domain (some of which may not be active yet). */ - @Transient Set gracePeriods; + @Ignore @Transient Set gracePeriods; /** * The id of the signed mark that was used to create this domain in sunrise. @@ -225,7 +227,7 @@ public class DomainBase extends EppResource String smdId; /** Data about any pending or past transfers on this domain. */ - DomainTransferData transferData; + @Ignore DomainTransferData transferData; /** * The time that this resource was last transferred. diff --git a/core/src/main/java/google/registry/model/domain/DomainHistory.java b/core/src/main/java/google/registry/model/domain/DomainHistory.java index f271149dc..e752c9995 100644 --- a/core/src/main/java/google/registry/model/domain/DomainHistory.java +++ b/core/src/main/java/google/registry/model/domain/DomainHistory.java @@ -20,6 +20,7 @@ import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy; import com.google.common.collect.ImmutableSet; import com.googlecode.objectify.Key; import com.googlecode.objectify.annotation.EntitySubclass; +import com.googlecode.objectify.annotation.Ignore; import google.registry.model.EppResource; import google.registry.model.ImmutableObject; import google.registry.model.domain.DomainHistory.DomainHistoryId; @@ -133,6 +134,7 @@ public class DomainHistory extends HistoryEntry { updatable = false) }) // HashSet rather than ImmutableSet so that Hibernate can fill them out lazily on request + @Ignore Set dsDataHistories = new HashSet<>(); @DoNotCompare @@ -153,6 +155,7 @@ public class DomainHistory extends HistoryEntry { updatable = false) }) // HashSet rather than ImmutableSet so that Hibernate can fill them out lazily on request + @Ignore Set gracePeriodHistories = new HashSet<>(); @Override diff --git a/core/src/main/java/google/registry/model/domain/GracePeriod.java b/core/src/main/java/google/registry/model/domain/GracePeriod.java index 877e4e388..cea377b37 100644 --- a/core/src/main/java/google/registry/model/domain/GracePeriod.java +++ b/core/src/main/java/google/registry/model/domain/GracePeriod.java @@ -19,7 +19,6 @@ import static google.registry.model.IdService.allocateId; import static google.registry.util.PreconditionsUtils.checkArgumentNotNull; import com.google.common.annotations.VisibleForTesting; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.billing.BillingEvent; import google.registry.model.billing.BillingEvent.Recurring; import google.registry.model.domain.DomainHistory.DomainHistoryId; @@ -40,7 +39,6 @@ import org.joda.time.DateTime; *

When a grace period expires, it is lazily removed from the {@link Domain} the next time the * resource is loaded from Datastore. */ -@Embed @Entity @Table( indexes = { diff --git a/core/src/main/java/google/registry/model/domain/GracePeriodBase.java b/core/src/main/java/google/registry/model/domain/GracePeriodBase.java index c43636e11..e731298f8 100644 --- a/core/src/main/java/google/registry/model/domain/GracePeriodBase.java +++ b/core/src/main/java/google/registry/model/domain/GracePeriodBase.java @@ -14,8 +14,6 @@ package google.registry.model.domain; -import com.googlecode.objectify.annotation.Embed; -import com.googlecode.objectify.annotation.Ignore; import google.registry.model.ImmutableObject; import google.registry.model.UnsafeSerializable; import google.registry.model.billing.BillingEvent; @@ -31,7 +29,6 @@ import javax.persistence.Transient; import org.joda.time.DateTime; /** Base class containing common fields and methods for {@link GracePeriod}. */ -@Embed @MappedSuperclass @Access(AccessType.FIELD) public class GracePeriodBase extends ImmutableObject implements UnsafeSerializable { @@ -40,7 +37,6 @@ public class GracePeriodBase extends ImmutableObject implements UnsafeSerializab @Transient long gracePeriodId; /** Repository id for the domain which this grace period belongs to. */ - @Ignore @Column(nullable = false) String domainRepoId; @@ -65,7 +61,6 @@ public class GracePeriodBase extends ImmutableObject implements UnsafeSerializab // NB: Would @IgnoreSave(IfNull.class), but not allowed for @Embed collections. @Access(AccessType.FIELD) @Column(name = "billing_event_id") - @Ignore VKey billingEventOneTime = null; /** @@ -75,7 +70,6 @@ public class GracePeriodBase extends ImmutableObject implements UnsafeSerializab // NB: Would @IgnoreSave(IfNull.class), but not allowed for @Embed collections. @Access(AccessType.FIELD) @Column(name = "billing_recurrence_id") - @Ignore VKey billingEventRecurring = null; public long getGracePeriodId() { diff --git a/core/src/main/java/google/registry/model/domain/Period.java b/core/src/main/java/google/registry/model/domain/Period.java index c2841bf7a..98fa192c9 100644 --- a/core/src/main/java/google/registry/model/domain/Period.java +++ b/core/src/main/java/google/registry/model/domain/Period.java @@ -14,9 +14,9 @@ package google.registry.model.domain; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.ImmutableObject; import google.registry.model.UnsafeSerializable; +import javax.persistence.Embeddable; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.xml.bind.annotation.XmlAttribute; @@ -24,8 +24,7 @@ import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlValue; /** The "periodType" from RFC5731. */ -@Embed -@javax.persistence.Embeddable +@Embeddable public class Period extends ImmutableObject implements UnsafeSerializable { @Enumerated(EnumType.STRING) diff --git a/core/src/main/java/google/registry/model/domain/launch/LaunchNotice.java b/core/src/main/java/google/registry/model/domain/launch/LaunchNotice.java index 048a333d4..4626fa2f2 100644 --- a/core/src/main/java/google/registry/model/domain/launch/LaunchNotice.java +++ b/core/src/main/java/google/registry/model/domain/launch/LaunchNotice.java @@ -23,12 +23,10 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; import com.google.common.base.Ascii; import com.google.common.base.CharMatcher; import com.google.common.primitives.Ints; -import com.googlecode.objectify.annotation.Embed; -import com.googlecode.objectify.annotation.IgnoreSave; -import com.googlecode.objectify.condition.IfNull; import google.registry.model.ImmutableObject; import google.registry.model.UnsafeSerializable; import java.util.Optional; +import javax.persistence.Embeddable; import javax.persistence.Embedded; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; @@ -37,17 +35,15 @@ import javax.xml.bind.annotation.XmlValue; import org.joda.time.DateTime; /** The claims notice id from the claims phase. */ -@Embed @XmlType(propOrder = {"noticeId", "expirationTime", "acceptedTime"}) -@javax.persistence.Embeddable +@Embeddable public class LaunchNotice extends ImmutableObject implements UnsafeSerializable { /** An empty instance to use in place of null. */ private static final NoticeIdType EMPTY_NOTICE_ID = new NoticeIdType(); /** An id with a validator-id attribute. */ - @Embed - @javax.persistence.Embeddable + @Embeddable public static class NoticeIdType extends ImmutableObject implements UnsafeSerializable { /** @@ -57,7 +53,6 @@ public class LaunchNotice extends ImmutableObject implements UnsafeSerializable @XmlValue String tcnId; /** The identifier of the TMDB provider to use, defaulting to the TMCH. */ - @IgnoreSave(IfNull.class) @XmlAttribute(name = "validatorID") String validatorId; diff --git a/core/src/main/java/google/registry/model/domain/launch/LaunchPhase.java b/core/src/main/java/google/registry/model/domain/launch/LaunchPhase.java index 93d92b57e..4e196a890 100644 --- a/core/src/main/java/google/registry/model/domain/launch/LaunchPhase.java +++ b/core/src/main/java/google/registry/model/domain/launch/LaunchPhase.java @@ -16,7 +16,6 @@ package google.registry.model.domain.launch; import static java.util.Objects.hash; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.ImmutableObject; import java.util.Objects; import javax.xml.bind.annotation.XmlAttribute; @@ -47,7 +46,6 @@ import javax.xml.bind.annotation.XmlValue; * sets it is the one that needs to make sure the domain isn't a trademark and that the fields are * correct. */ -@Embed public class LaunchPhase extends ImmutableObject { /** diff --git a/core/src/main/java/google/registry/model/domain/secdns/DelegationSignerData.java b/core/src/main/java/google/registry/model/domain/secdns/DelegationSignerData.java index 06e360ea3..066d784a1 100644 --- a/core/src/main/java/google/registry/model/domain/secdns/DelegationSignerData.java +++ b/core/src/main/java/google/registry/model/domain/secdns/DelegationSignerData.java @@ -16,7 +16,6 @@ package google.registry.model.domain.secdns; import static google.registry.util.PreconditionsUtils.checkArgumentNotNull; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.ImmutableObject; import google.registry.model.domain.secdns.DelegationSignerData.DomainDsDataId; import java.io.Serializable; @@ -37,7 +36,6 @@ import javax.xml.bind.annotation.XmlType; * @see RFC 4034 *

TODO(b/177567432): Rename this class to DomainDsData. */ -@Embed @XmlType(name = "dsData") @Entity @IdClass(DomainDsDataId.class) diff --git a/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataBase.java b/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataBase.java index 739c7e20e..b5821d68a 100644 --- a/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataBase.java +++ b/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataBase.java @@ -14,8 +14,6 @@ package google.registry.model.domain.secdns; -import com.googlecode.objectify.annotation.Embed; -import com.googlecode.objectify.annotation.Ignore; import google.registry.model.ImmutableObject; import google.registry.model.UnsafeSerializable; import javax.persistence.Access; @@ -29,12 +27,11 @@ import javax.xml.bind.annotation.adapters.HexBinaryAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** Base class for {@link DelegationSignerData} and {@link DomainDsDataHistory}. */ -@Embed @MappedSuperclass @Access(AccessType.FIELD) public abstract class DomainDsDataBase extends ImmutableObject implements UnsafeSerializable { - @Ignore @XmlTransient @Transient String domainRepoId; + @XmlTransient @Transient String domainRepoId; /** The identifier for this particular key in the domain. */ @Transient int keyTag; diff --git a/core/src/main/java/google/registry/model/domain/secdns/SecDnsInfoExtension.java b/core/src/main/java/google/registry/model/domain/secdns/SecDnsInfoExtension.java index e14f297eb..4e15a6720 100644 --- a/core/src/main/java/google/registry/model/domain/secdns/SecDnsInfoExtension.java +++ b/core/src/main/java/google/registry/model/domain/secdns/SecDnsInfoExtension.java @@ -15,14 +15,12 @@ package google.registry.model.domain.secdns; import com.google.common.collect.ImmutableSet; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.ImmutableObject; import google.registry.model.eppoutput.EppResponse.ResponseExtension; import javax.xml.bind.annotation.XmlRootElement; /** The EPP secDNS extension to be returned with domain info commands. */ @XmlRootElement(name = "infData") -@Embed public class SecDnsInfoExtension extends ImmutableObject implements ResponseExtension { /** Signatures for this domain. */ diff --git a/core/src/main/java/google/registry/model/eppcommon/AuthInfo.java b/core/src/main/java/google/registry/model/eppcommon/AuthInfo.java index 3f89c45f8..3eab36dc9 100644 --- a/core/src/main/java/google/registry/model/eppcommon/AuthInfo.java +++ b/core/src/main/java/google/registry/model/eppcommon/AuthInfo.java @@ -14,7 +14,6 @@ package google.registry.model.eppcommon; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.ImmutableObject; import google.registry.model.UnsafeSerializable; import javax.persistence.Embeddable; @@ -45,7 +44,6 @@ public abstract class AuthInfo extends ImmutableObject implements UnsafeSerializ } /** The "pwAuthInfoType" complex type. */ - @Embed @XmlType(namespace = "urn:ietf:params:xml:ns:eppcom-1.0") @Embeddable public static class PasswordAuth extends ImmutableObject implements UnsafeSerializable { diff --git a/core/src/main/java/google/registry/model/eppcommon/PresenceMarker.java b/core/src/main/java/google/registry/model/eppcommon/PresenceMarker.java index 2eb4f0060..225d5bf08 100644 --- a/core/src/main/java/google/registry/model/eppcommon/PresenceMarker.java +++ b/core/src/main/java/google/registry/model/eppcommon/PresenceMarker.java @@ -14,7 +14,6 @@ package google.registry.model.eppcommon; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.ImmutableObject; import java.io.Serializable; import javax.persistence.Embeddable; @@ -26,7 +25,6 @@ import javax.xml.bind.annotation.XmlTransient; *

When placed in a field "foo", this will correctly unmarshal from both {@code } and * {@code }, and will unmarshal always to {@code }. */ -@Embed @Embeddable public class PresenceMarker extends ImmutableObject implements Serializable { @XmlTransient diff --git a/core/src/main/java/google/registry/model/eppcommon/Trid.java b/core/src/main/java/google/registry/model/eppcommon/Trid.java index f16b6f90c..0d4e258a7 100644 --- a/core/src/main/java/google/registry/model/eppcommon/Trid.java +++ b/core/src/main/java/google/registry/model/eppcommon/Trid.java @@ -16,11 +16,11 @@ package google.registry.model.eppcommon; import static google.registry.util.PreconditionsUtils.checkArgumentNotNull; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.ImmutableObject; import google.registry.model.UnsafeSerializable; import java.util.Optional; import javax.annotation.Nullable; +import javax.persistence.Embeddable; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @@ -30,9 +30,8 @@ import javax.xml.bind.annotation.XmlType; * is formed using the {@code clTRID} associated with the command if supplied by the client and a * {@code svTRID} (server transaction identifier) that is assigned by and unique to the server." */ -@Embed @XmlType(propOrder = {"clientTransactionId", "serverTransactionId"}) -@javax.persistence.Embeddable +@Embeddable public class Trid extends ImmutableObject implements UnsafeSerializable { /** The server transaction id. */ diff --git a/core/src/main/java/google/registry/model/poll/PendingActionNotificationResponse.java b/core/src/main/java/google/registry/model/poll/PendingActionNotificationResponse.java index 32c94726a..1f463fd30 100644 --- a/core/src/main/java/google/registry/model/poll/PendingActionNotificationResponse.java +++ b/core/src/main/java/google/registry/model/poll/PendingActionNotificationResponse.java @@ -15,7 +15,6 @@ package google.registry.model.poll; import com.google.common.annotations.VisibleForTesting; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.ImmutableObject; import google.registry.model.UnsafeSerializable; import google.registry.model.eppcommon.Trid; @@ -36,7 +35,6 @@ public class PendingActionNotificationResponse extends ImmutableObject implements ResponseData, UnsafeSerializable { /** The inner name type that contains a name and the result boolean. */ - @Embed @Embeddable static class NameOrId extends ImmutableObject implements UnsafeSerializable { @XmlValue @@ -80,7 +78,6 @@ public class PendingActionNotificationResponse extends ImmutableObject } /** An adapter to output the XML in response to resolving a pending command on a domain. */ - @Embed @XmlRootElement(name = "panData", namespace = "urn:ietf:params:xml:ns:domain-1.0") @XmlType( propOrder = {"name", "trid", "processedDate"}, @@ -105,7 +102,6 @@ public class PendingActionNotificationResponse extends ImmutableObject } /** An adapter to output the XML in response to resolving a pending command on a contact. */ - @Embed @XmlRootElement(name = "panData", namespace = "urn:ietf:params:xml:ns:contact-1.0") @XmlType( propOrder = {"id", "trid", "processedDate"}, @@ -130,7 +126,6 @@ public class PendingActionNotificationResponse extends ImmutableObject } /** An adapter to output the XML in response to resolving a pending command on a host. */ - @Embed @XmlRootElement(name = "panData", namespace = "urn:ietf:params:xml:ns:domain-1.0") @XmlType( propOrder = {"name", "trid", "processedDate"}, diff --git a/core/src/main/java/google/registry/model/reporting/DomainTransactionRecord.java b/core/src/main/java/google/registry/model/reporting/DomainTransactionRecord.java index 52969cec5..25eb0cb9a 100644 --- a/core/src/main/java/google/registry/model/reporting/DomainTransactionRecord.java +++ b/core/src/main/java/google/registry/model/reporting/DomainTransactionRecord.java @@ -18,8 +18,6 @@ import static com.google.common.base.Preconditions.checkArgument; import static google.registry.util.PreconditionsUtils.checkArgumentNotNull; import com.google.common.collect.ImmutableSet; -import com.googlecode.objectify.annotation.Embed; -import com.googlecode.objectify.annotation.Ignore; import google.registry.model.Buildable; import google.registry.model.ImmutableObject; import google.registry.model.UnsafeSerializable; @@ -43,15 +41,13 @@ import org.joda.time.DateTime; * only exception is for reportField = TRANSFER_LOSING_SUCCESSFUL or TRANSFER_LOSING_NACKED, which * uses HistoryEntry.otherClientId because the losing party in a transfer is always the otherClient. */ -@Embed @Entity public class DomainTransactionRecord extends ImmutableObject implements Buildable, UnsafeSerializable { @Id - @Ignore @GeneratedValue(strategy = GenerationType.IDENTITY) - @ImmutableObject.Insignificant + @Insignificant Long id; /** The TLD this record operates on. */ @@ -62,9 +58,9 @@ public class DomainTransactionRecord extends ImmutableObject // Datastore-SQL validation. They are excluded from equality check since they are not set in // Datastore. // TODO(b/203609782): post migration, decide whether to keep these two fields. - @Ignore @ImmutableObject.Insignificant String domainRepoId; + @Insignificant String domainRepoId; - @Ignore @ImmutableObject.Insignificant Long historyRevisionId; + @Insignificant Long historyRevisionId; /** * The time this Transaction takes effect (counting grace periods and other nuances). diff --git a/core/src/main/java/google/registry/model/reporting/HistoryEntry.java b/core/src/main/java/google/registry/model/reporting/HistoryEntry.java index 8a1bfbbe2..37c425172 100644 --- a/core/src/main/java/google/registry/model/reporting/HistoryEntry.java +++ b/core/src/main/java/google/registry/model/reporting/HistoryEntry.java @@ -25,10 +25,9 @@ import com.google.common.collect.ImmutableSet; import com.googlecode.objectify.Key; import com.googlecode.objectify.annotation.Entity; import com.googlecode.objectify.annotation.Id; -import com.googlecode.objectify.annotation.IgnoreSave; +import com.googlecode.objectify.annotation.Ignore; import com.googlecode.objectify.annotation.Index; import com.googlecode.objectify.annotation.Parent; -import com.googlecode.objectify.condition.IfNull; import google.registry.model.Buildable; import google.registry.model.EppResource; import google.registry.model.ImmutableObject; @@ -155,8 +154,7 @@ public class HistoryEntry extends ImmutableObject implements Buildable, UnsafeSe * The length of time that a create, allocate, renewal, or transfer request was issued for. Will * be null for all other types. */ - @IgnoreSave(IfNull.class) - @Transient // domain-specific + @Ignore @Transient // domain-specific Period period; /** @@ -189,6 +187,7 @@ public class HistoryEntry extends ImmutableObject implements Buildable, UnsafeSe /** Transaction id that made this change, or null if the entry was not created by a flow. */ @Nullable + @Ignore @AttributeOverrides({ @AttributeOverride( name = "clientTransactionId", @@ -218,6 +217,7 @@ public class HistoryEntry extends ImmutableObject implements Buildable, UnsafeSe * also be empty if the HistoryEntry refers to an EPP mutation that does not affect domain * transaction counts (such as contact or host mutations). */ + @Ignore @Transient // domain-specific @ImmutableObject.EmptySetToNull protected Set domainTransactionRecords; diff --git a/core/src/main/java/google/registry/model/smd/EncodedSignedMark.java b/core/src/main/java/google/registry/model/smd/EncodedSignedMark.java index 26e3eb0a6..9edcaa218 100644 --- a/core/src/main/java/google/registry/model/smd/EncodedSignedMark.java +++ b/core/src/main/java/google/registry/model/smd/EncodedSignedMark.java @@ -18,7 +18,6 @@ import static com.google.common.base.MoreObjects.firstNonNull; import static com.google.common.io.BaseEncoding.base64; import com.google.appengine.api.datastore.Text; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.ImmutableObject; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; @@ -31,7 +30,6 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; * @see * draft-lozano-tmch-smd-02 § 2.4 */ -@Embed @XmlRootElement(name = "encodedSignedMark") public class EncodedSignedMark extends ImmutableObject implements AbstractSignedMark { @@ -42,8 +40,9 @@ public class EncodedSignedMark extends ImmutableObject implements AbstractSigned String encoding; /** - * Encoded data. This is stored in a Text field rather than a String because Objectify cannot - * autoconvert Strings greater than 500 characters to Text within {@link Embed} collections. + * Encoded data. This is stored in a Text field rather than a String due to historical reasons, + * namely that Objectify cannot autoconvert Strings greater than 500 characters to Text within + * {@code Embed} collections. */ @XmlValue @XmlJavaTypeAdapter(RemoveWhitespaceTextAdapter.class) diff --git a/core/src/main/java/google/registry/model/transfer/ContactTransferData.java b/core/src/main/java/google/registry/model/transfer/ContactTransferData.java index 7da7ccb9b..7f92dd27e 100644 --- a/core/src/main/java/google/registry/model/transfer/ContactTransferData.java +++ b/core/src/main/java/google/registry/model/transfer/ContactTransferData.java @@ -14,13 +14,9 @@ package google.registry.model.transfer; -import com.googlecode.objectify.annotation.Embed; -import com.googlecode.objectify.annotation.Unindex; import javax.persistence.Embeddable; /** Transfer data for contact. */ -@Embed -@Unindex @Embeddable public class ContactTransferData extends TransferData { public static final ContactTransferData EMPTY = new ContactTransferData(); diff --git a/core/src/main/java/google/registry/model/transfer/DomainTransferData.java b/core/src/main/java/google/registry/model/transfer/DomainTransferData.java index fec3755d3..adbf881bd 100644 --- a/core/src/main/java/google/registry/model/transfer/DomainTransferData.java +++ b/core/src/main/java/google/registry/model/transfer/DomainTransferData.java @@ -17,11 +17,6 @@ package google.registry.model.transfer; import static google.registry.util.CollectionUtils.isNullOrEmpty; import com.google.common.collect.ImmutableSet; -import com.googlecode.objectify.annotation.Embed; -import com.googlecode.objectify.annotation.Ignore; -import com.googlecode.objectify.annotation.IgnoreSave; -import com.googlecode.objectify.annotation.Unindex; -import com.googlecode.objectify.condition.IfNull; import google.registry.model.billing.BillingEvent; import google.registry.model.domain.Period; import google.registry.model.domain.Period.Unit; @@ -38,8 +33,6 @@ import javax.persistence.Embedded; import org.joda.time.DateTime; /** Transfer data for domain. */ -@Embed -@Unindex @Embeddable public class DomainTransferData extends TransferData { public static final DomainTransferData EMPTY = new DomainTransferData(); @@ -75,7 +68,6 @@ public class DomainTransferData extends TransferData @Column(name = "transfer_registration_expiration_time") DateTime transferredRegistrationExpirationTime; - @Ignore @Column(name = "transfer_billing_cancellation_id") public VKey billingCancellationId; @@ -86,7 +78,6 @@ public class DomainTransferData extends TransferData * being transferred is not a domain. */ @Column(name = "transfer_billing_event_id") - @Ignore VKey serverApproveBillingEvent; /** @@ -96,7 +87,6 @@ public class DomainTransferData extends TransferData * being transferred is not a domain. */ @Column(name = "transfer_billing_recurrence_id") - @Ignore VKey serverApproveAutorenewEvent; /** @@ -105,7 +95,6 @@ public class DomainTransferData extends TransferData *

This field should be null if there is not currently a pending transfer or if the object * being transferred is not a domain. */ - @IgnoreSave(IfNull.class) @Column(name = "transfer_autorenew_poll_message_id") VKey serverApproveAutorenewPollMessage; @@ -113,7 +102,6 @@ public class DomainTransferData extends TransferData * Autorenew history, which we need to preserve because it's often used in contexts where we * haven't loaded the autorenew object. */ - @Ignore @Column(name = "transfer_autorenew_poll_message_history_id") Long serverApproveAutorenewPollMessageHistoryId; diff --git a/core/src/main/java/google/registry/model/transfer/TransferResponse.java b/core/src/main/java/google/registry/model/transfer/TransferResponse.java index 8407d60a1..c72ab210e 100644 --- a/core/src/main/java/google/registry/model/transfer/TransferResponse.java +++ b/core/src/main/java/google/registry/model/transfer/TransferResponse.java @@ -14,7 +14,6 @@ package google.registry.model.transfer; -import com.googlecode.objectify.annotation.Embed; import google.registry.model.EppResource; import google.registry.model.eppoutput.EppResponse.ResponseData; import javax.persistence.Embeddable; @@ -33,7 +32,6 @@ import org.joda.time.DateTime; public class TransferResponse extends BaseTransferObject implements ResponseData { /** An adapter to output the XML in response to a transfer command on a domain. */ - @Embed @XmlRootElement(name = "trnData", namespace = "urn:ietf:params:xml:ns:domain-1.0") @XmlType(propOrder = { "fullyQualifiedDomainName", @@ -82,7 +80,6 @@ public class TransferResponse extends BaseTransferObject implements ResponseData } /** An adapter to output the XML in response to a transfer command on a contact. */ - @Embed @XmlRootElement(name = "trnData", namespace = "urn:ietf:params:xml:ns:contact-1.0") @XmlType(propOrder = { "contactId", diff --git a/core/src/test/resources/google/registry/model/schema.txt b/core/src/test/resources/google/registry/model/schema.txt index dd071b62c..f751964ff 100644 --- a/core/src/test/resources/google/registry/model/schema.txt +++ b/core/src/test/resources/google/registry/model/schema.txt @@ -4,39 +4,24 @@ class google.registry.model.common.GaeUserIdConverter { } class google.registry.model.contact.Contact { @Id java.lang.String repoId; - google.registry.model.contact.ContactAuthInfo authInfo; - google.registry.model.contact.ContactPhoneNumber fax; - google.registry.model.contact.ContactPhoneNumber voice; - google.registry.model.contact.Disclose disclose; - google.registry.model.transfer.ContactTransferData transferData; java.lang.String contactId; java.lang.String creationClientId; java.lang.String currentSponsorClientId; java.lang.String email; java.lang.String lastEppUpdateClientId; java.lang.String searchName; - java.util.Set status; org.joda.time.DateTime deletionTime; org.joda.time.DateTime lastEppUpdateTime; org.joda.time.DateTime lastTransferTime; } -class google.registry.model.contact.ContactAuthInfo { - google.registry.model.eppcommon.AuthInfo$PasswordAuth pw; -} class google.registry.model.contact.ContactBase { @Id java.lang.String repoId; - google.registry.model.contact.ContactAuthInfo authInfo; - google.registry.model.contact.ContactPhoneNumber fax; - google.registry.model.contact.ContactPhoneNumber voice; - google.registry.model.contact.Disclose disclose; - google.registry.model.transfer.ContactTransferData transferData; java.lang.String contactId; java.lang.String creationClientId; java.lang.String currentSponsorClientId; java.lang.String email; java.lang.String lastEppUpdateClientId; java.lang.String searchName; - java.util.Set status; org.joda.time.DateTime deletionTime; org.joda.time.DateTime lastEppUpdateTime; org.joda.time.DateTime lastTransferTime; @@ -47,41 +32,15 @@ class google.registry.model.contact.ContactHistory { boolean bySuperuser; byte[] xmlBytes; google.registry.model.contact.ContactBase contactBase; - google.registry.model.domain.Period period; - google.registry.model.eppcommon.Trid trid; google.registry.model.reporting.HistoryEntry$Type type; java.lang.Boolean requestedByRegistrar; java.lang.String clientId; java.lang.String otherClientId; java.lang.String reason; - java.util.Set domainTransactionRecords; org.joda.time.DateTime modificationTime; } -class google.registry.model.contact.ContactPhoneNumber { - java.lang.String extension; - java.lang.String phoneNumber; -} -class google.registry.model.contact.Disclose { - google.registry.model.eppcommon.PresenceMarker email; - google.registry.model.eppcommon.PresenceMarker fax; - google.registry.model.eppcommon.PresenceMarker voice; - java.lang.Boolean flag; - java.util.List addr; - java.util.List name; - java.util.List org; -} -class google.registry.model.contact.Disclose$PostalInfoChoice { - google.registry.model.contact.PostalInfo$Type type; -} -enum google.registry.model.contact.PostalInfo$Type { - INTERNATIONALIZED; - LOCALIZED; -} class google.registry.model.domain.Domain { @Id java.lang.String repoId; - google.registry.model.domain.DomainAuthInfo authInfo; - google.registry.model.domain.launch.LaunchNotice launchNotice; - google.registry.model.transfer.DomainTransferData transferData; google.registry.persistence.VKey adminContact; google.registry.persistence.VKey billingContact; google.registry.persistence.VKey registrantContact; @@ -95,9 +54,6 @@ class google.registry.model.domain.Domain { java.lang.String lastEppUpdateClientId; java.lang.String smdId; java.lang.String tld; - java.util.Set gracePeriods; - java.util.Set dsData; - java.util.Set status; java.util.Set> nsHosts; java.util.Set subordinateHosts; org.joda.time.DateTime autorenewEndTime; @@ -106,14 +62,8 @@ class google.registry.model.domain.Domain { org.joda.time.DateTime lastTransferTime; org.joda.time.DateTime registrationExpirationTime; } -class google.registry.model.domain.DomainAuthInfo { - google.registry.model.eppcommon.AuthInfo$PasswordAuth pw; -} class google.registry.model.domain.DomainBase { @Id java.lang.String repoId; - google.registry.model.domain.DomainAuthInfo authInfo; - google.registry.model.domain.launch.LaunchNotice launchNotice; - google.registry.model.transfer.DomainTransferData transferData; google.registry.persistence.VKey adminContact; google.registry.persistence.VKey billingContact; google.registry.persistence.VKey registrantContact; @@ -127,9 +77,6 @@ class google.registry.model.domain.DomainBase { java.lang.String lastEppUpdateClientId; java.lang.String smdId; java.lang.String tld; - java.util.Set gracePeriods; - java.util.Set dsData; - java.util.Set status; java.util.Set> nsHosts; java.util.Set subordinateHosts; org.joda.time.DateTime autorenewEndTime; @@ -144,103 +91,14 @@ class google.registry.model.domain.DomainHistory { boolean bySuperuser; byte[] xmlBytes; google.registry.model.domain.DomainBase domainBase; - google.registry.model.domain.Period period; - google.registry.model.eppcommon.Trid trid; google.registry.model.reporting.HistoryEntry$Type type; java.lang.Boolean requestedByRegistrar; java.lang.String clientId; java.lang.String otherClientId; java.lang.String reason; - java.util.Set gracePeriodHistories; - java.util.Set dsDataHistories; - java.util.Set domainTransactionRecords; java.util.Set> nsHosts; org.joda.time.DateTime modificationTime; } -class google.registry.model.domain.GracePeriod { - google.registry.model.domain.rgp.GracePeriodStatus type; - java.lang.String clientId; - long gracePeriodId; - org.joda.time.DateTime expirationTime; -} -class google.registry.model.domain.GracePeriod$GracePeriodHistory { - google.registry.model.domain.rgp.GracePeriodStatus type; - java.lang.Long domainHistoryRevisionId; - java.lang.Long gracePeriodHistoryRevisionId; - java.lang.String clientId; - long gracePeriodId; - org.joda.time.DateTime expirationTime; -} -class google.registry.model.domain.Period { - google.registry.model.domain.Period$Unit unit; - java.lang.Integer value; -} -enum google.registry.model.domain.Period$Unit { - MONTHS; - YEARS; -} -class google.registry.model.domain.launch.LaunchNotice { - google.registry.model.domain.launch.LaunchNotice$NoticeIdType noticeId; - org.joda.time.DateTime acceptedTime; - org.joda.time.DateTime expirationTime; -} -class google.registry.model.domain.launch.LaunchNotice$NoticeIdType { - java.lang.String tcnId; - java.lang.String validatorId; -} -enum google.registry.model.domain.rgp.GracePeriodStatus { - ADD; - AUTO_RENEW; - PENDING_DELETE; - PENDING_RESTORE; - REDEMPTION; - RENEW; - TRANSFER; -} -class google.registry.model.domain.secdns.DelegationSignerData { - byte[] digest; - int algorithm; - int digestType; - int keyTag; -} -class google.registry.model.domain.secdns.DomainDsDataHistory { - byte[] digest; - int algorithm; - int digestType; - int keyTag; - java.lang.Long domainHistoryRevisionId; - java.lang.Long dsDataHistoryRevisionId; -} -class google.registry.model.eppcommon.AuthInfo$PasswordAuth { - java.lang.String repoId; - java.lang.String value; -} -class google.registry.model.eppcommon.PresenceMarker { - boolean marked; -} -enum google.registry.model.eppcommon.StatusValue { - CLIENT_DELETE_PROHIBITED; - CLIENT_HOLD; - CLIENT_RENEW_PROHIBITED; - CLIENT_TRANSFER_PROHIBITED; - CLIENT_UPDATE_PROHIBITED; - INACTIVE; - LINKED; - OK; - PENDING_CREATE; - PENDING_DELETE; - PENDING_TRANSFER; - PENDING_UPDATE; - SERVER_DELETE_PROHIBITED; - SERVER_HOLD; - SERVER_RENEW_PROHIBITED; - SERVER_TRANSFER_PROHIBITED; - SERVER_UPDATE_PROHIBITED; -} -class google.registry.model.eppcommon.Trid { - java.lang.String clientTransactionId; - java.lang.String serverTransactionId; -} class google.registry.model.host.Host { @Id java.lang.String repoId; google.registry.persistence.VKey superordinateDomain; @@ -248,7 +106,6 @@ class google.registry.model.host.Host { java.lang.String currentSponsorClientId; java.lang.String fullyQualifiedHostName; java.lang.String lastEppUpdateClientId; - java.util.Set status; java.util.Set inetAddresses; org.joda.time.DateTime deletionTime; org.joda.time.DateTime lastEppUpdateTime; @@ -262,7 +119,6 @@ class google.registry.model.host.HostBase { java.lang.String currentSponsorClientId; java.lang.String fullyQualifiedHostName; java.lang.String lastEppUpdateClientId; - java.util.Set status; java.util.Set inetAddresses; org.joda.time.DateTime deletionTime; org.joda.time.DateTime lastEppUpdateTime; @@ -274,15 +130,12 @@ class google.registry.model.host.HostHistory { @Parent com.googlecode.objectify.Key parent; boolean bySuperuser; byte[] xmlBytes; - google.registry.model.domain.Period period; - google.registry.model.eppcommon.Trid trid; google.registry.model.host.HostBase hostBase; google.registry.model.reporting.HistoryEntry$Type type; java.lang.Boolean requestedByRegistrar; java.lang.String clientId; java.lang.String otherClientId; java.lang.String reason; - java.util.Set domainTransactionRecords; org.joda.time.DateTime modificationTime; } class google.registry.model.index.EppResourceIndex { @@ -294,52 +147,16 @@ class google.registry.model.index.EppResourceIndex { class google.registry.model.index.EppResourceIndexBucket { @Id long bucketId; } -class google.registry.model.reporting.DomainTransactionRecord { - google.registry.model.reporting.DomainTransactionRecord$TransactionReportField reportField; - java.lang.Integer reportAmount; - java.lang.String tld; - org.joda.time.DateTime reportingTime; -} -enum google.registry.model.reporting.DomainTransactionRecord$TransactionReportField { - DELETED_DOMAINS_GRACE; - DELETED_DOMAINS_NOGRACE; - NET_ADDS_10_YR; - NET_ADDS_1_YR; - NET_ADDS_2_YR; - NET_ADDS_3_YR; - NET_ADDS_4_YR; - NET_ADDS_5_YR; - NET_ADDS_6_YR; - NET_ADDS_7_YR; - NET_ADDS_8_YR; - NET_ADDS_9_YR; - NET_RENEWS_10_YR; - NET_RENEWS_1_YR; - NET_RENEWS_2_YR; - NET_RENEWS_3_YR; - NET_RENEWS_4_YR; - NET_RENEWS_5_YR; - NET_RENEWS_6_YR; - NET_RENEWS_7_YR; - NET_RENEWS_8_YR; - NET_RENEWS_9_YR; - RESTORED_DOMAINS; - TRANSFER_NACKED; - TRANSFER_SUCCESSFUL; -} class google.registry.model.reporting.HistoryEntry { @Id java.lang.Long id; @Parent com.googlecode.objectify.Key parent; boolean bySuperuser; byte[] xmlBytes; - google.registry.model.domain.Period period; - google.registry.model.eppcommon.Trid trid; google.registry.model.reporting.HistoryEntry$Type type; java.lang.Boolean requestedByRegistrar; java.lang.String clientId; java.lang.String otherClientId; java.lang.String reason; - java.util.Set domainTransactionRecords; org.joda.time.DateTime modificationTime; } enum google.registry.model.reporting.HistoryEntry$Type { @@ -376,30 +193,3 @@ class google.registry.model.server.ServerSecret { long leastSignificant; long mostSignificant; } -class google.registry.model.transfer.ContactTransferData { - google.registry.model.eppcommon.Trid transferRequestTrid; - google.registry.model.transfer.TransferStatus transferStatus; - java.lang.String gainingClientId; - java.lang.String losingClientId; - org.joda.time.DateTime pendingTransferExpirationTime; - org.joda.time.DateTime transferRequestTime; -} -class google.registry.model.transfer.DomainTransferData { - google.registry.model.domain.Period transferPeriod; - google.registry.model.eppcommon.Trid transferRequestTrid; - google.registry.model.transfer.TransferStatus transferStatus; - google.registry.persistence.VKey serverApproveAutorenewPollMessage; - java.lang.String gainingClientId; - java.lang.String losingClientId; - org.joda.time.DateTime pendingTransferExpirationTime; - org.joda.time.DateTime transferRequestTime; - org.joda.time.DateTime transferredRegistrationExpirationTime; -} -enum google.registry.model.transfer.TransferStatus { - CLIENT_APPROVED; - CLIENT_CANCELLED; - CLIENT_REJECTED; - PENDING; - SERVER_APPROVED; - SERVER_CANCELLED; -}