diff --git a/core/src/main/java/google/registry/model/billing/BillingEvent.java b/core/src/main/java/google/registry/model/billing/BillingEvent.java index bb74d001e..2ef3817a2 100644 --- a/core/src/main/java/google/registry/model/billing/BillingEvent.java +++ b/core/src/main/java/google/registry/model/billing/BillingEvent.java @@ -67,7 +67,6 @@ import org.joda.time.DateTime; /** A billable event in a domain's lifecycle. */ @MappedSuperclass -@WithLongVKey public abstract class BillingEvent extends ImmutableObject implements Buildable, TransferServerApproveEntity { @@ -292,6 +291,7 @@ public abstract class BillingEvent extends ImmutableObject @javax.persistence.Index(columnList = "allocation_token_id") }) @AttributeOverride(name = "id", column = @Column(name = "billing_event_id")) + @WithLongVKey public static class OneTime extends BillingEvent implements DatastoreAndSqlEntity { /** The billable value. */ @@ -327,7 +327,7 @@ public abstract class BillingEvent extends ImmutableObject * Cancellation}s. */ @Column(name = "cancellation_matching_billing_recurrence_id") - VKey cancellationMatchingBillingEvent; + VKey cancellationMatchingBillingEvent; /** * The {@link AllocationToken} used in the creation of this event, or null if one was not used. @@ -409,7 +409,7 @@ public abstract class BillingEvent extends ImmutableObject } public Builder setCancellationMatchingBillingEvent( - VKey cancellationMatchingBillingEvent) { + VKey cancellationMatchingBillingEvent) { getInstance().cancellationMatchingBillingEvent = cancellationMatchingBillingEvent; return this; } @@ -468,6 +468,7 @@ public abstract class BillingEvent extends ImmutableObject @javax.persistence.Index(columnList = "recurrence_time_of_year") }) @AttributeOverride(name = "id", column = @Column(name = "billing_recurrence_id")) + @WithLongVKey public static class Recurring extends BillingEvent implements DatastoreAndSqlEntity { /** @@ -562,6 +563,7 @@ public abstract class BillingEvent extends ImmutableObject @javax.persistence.Index(columnList = "billingTime") }) @AttributeOverride(name = "id", column = @Column(name = "billing_cancellation_id")) + @WithLongVKey public static class Cancellation extends BillingEvent implements DatastoreAndSqlEntity { /** The billing time of the charge that is being cancelled. */ @@ -682,6 +684,7 @@ public abstract class BillingEvent extends ImmutableObject /** An event representing a modification of an existing one-time billing event. */ @ReportedOn @Entity + @WithLongVKey public static class Modification extends BillingEvent implements DatastoreAndSqlEntity { /** The change in cost that should be applied to the original billing event. */ diff --git a/core/src/main/resources/META-INF/persistence.xml b/core/src/main/resources/META-INF/persistence.xml index ee9a68c45..1d41fc06e 100644 --- a/core/src/main/resources/META-INF/persistence.xml +++ b/core/src/main/resources/META-INF/persistence.xml @@ -94,7 +94,10 @@ google.registry.persistence.converter.ZonedDateTimeConverter - google.registry.model.billing.VKeyConverter_BillingEvent + google.registry.model.billing.VKeyConverter_Cancellation + google.registry.model.billing.VKeyConverter_Modification + google.registry.model.billing.VKeyConverter_OneTime + google.registry.model.billing.VKeyConverter_Recurring google.registry.model.contact.VKeyConverter_ContactResource google.registry.model.domain.VKeyConverter_DomainBase google.registry.model.domain.token.VKeyConverter_AllocationToken diff --git a/core/src/test/resources/google/registry/model/schema.txt b/core/src/test/resources/google/registry/model/schema.txt index ac6266317..076502d99 100644 --- a/core/src/test/resources/google/registry/model/schema.txt +++ b/core/src/test/resources/google/registry/model/schema.txt @@ -41,7 +41,7 @@ class google.registry.model.billing.BillingEvent$OneTime { @Id java.lang.Long id; @Parent com.googlecode.objectify.Key parent; google.registry.model.billing.BillingEvent$Reason reason; - google.registry.persistence.VKey cancellationMatchingBillingEvent; + google.registry.persistence.VKey cancellationMatchingBillingEvent; google.registry.persistence.VKey allocationToken; java.lang.Integer periodYears; java.lang.String clientId;