Commit f46c9d4e authored by Christos Tranoris's avatar Christos Tranoris
Browse files

fixing model for jpa

parent 17eaa966
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -111,22 +111,22 @@ public class ProductOffering extends BaseEntity {
	private Set<ProductOfferingTerm> productOfferingTerm = new HashSet<>();

	@JsonProperty("productSpecification")
	@OneToOne( cascade = {CascadeType.MERGE, CascadeType.DETACH} )
	@OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH })
    @JoinColumn(referencedColumnName = "uuid")
	private ProductSpecificationRef productSpecification = null;

	@JsonProperty("resourceCandidate")
	@OneToOne( cascade = {CascadeType.MERGE, CascadeType.DETACH} )
    @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH })
    @JoinColumn(referencedColumnName = "uuid")
	private ResourceCandidateRef resourceCandidate = null;

	@JsonProperty("serviceCandidate")
	@OneToOne( cascade = {CascadeType.MERGE, CascadeType.DETACH} )
    @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH })
    @JoinColumn(referencedColumnName = "uuid")
	private ServiceCandidateRef serviceCandidate = null;

	@JsonProperty("serviceLevelAgreement")
	@OneToOne( cascade = {CascadeType.MERGE, CascadeType.DETACH} )
    @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH })
    @JoinColumn(referencedColumnName = "uuid")
	private SLARef serviceLevelAgreement = null;

+7 −75
Original line number Diff line number Diff line
@@ -48,15 +48,6 @@ public class PriceAlteration extends BaseRootNamedEntity {
  @OneToOne(cascade = CascadeType.ALL)
  private ProductOfferingPriceRef productOfferingPrice = null;

  @JsonProperty("@baseType")
  private String _atBaseType = null;

  @JsonProperty("@schemaLocation")
  private String _atSchemaLocation = null;

  @JsonProperty("@type")
  private String _atType = null;

  public PriceAlteration applicationDuration(Integer applicationDuration) {
    this.applicationDuration = applicationDuration;
    return this;
@@ -239,65 +230,6 @@ public class PriceAlteration extends BaseRootNamedEntity {
    this.productOfferingPrice = productOfferingPrice;
  }

  public PriceAlteration _atBaseType(String _atBaseType) {
    this._atBaseType = _atBaseType;
    return this;
  }

  /**
   * When sub-classing, this defines the super-class
   * @return _atBaseType
   **/
  @Schema(description = "When sub-classing, this defines the super-class")
      @NotNull

    public String getAtBaseType() {
    return _atBaseType;
  }

  public void setAtBaseType(String _atBaseType) {
    this._atBaseType = _atBaseType;
  }

  public PriceAlteration _atSchemaLocation(String _atSchemaLocation) {
    this._atSchemaLocation = _atSchemaLocation;
    return this;
  }

  /**
   * A URI to a JSON-Schema file that defines additional attributes and relationships
   * @return _atSchemaLocation
   **/
  @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships")
      @NotNull

    public String getAtSchemaLocation() {
    return _atSchemaLocation;
  }

  public void setAtSchemaLocation(String _atSchemaLocation) {
    this._atSchemaLocation = _atSchemaLocation;
  }

  public PriceAlteration _atType(String _atType) {
    this._atType = _atType;
    return this;
  }

  /**
   * When sub-classing, this defines the sub-class entity name
   * @return _atType
   **/
  @Schema(description = "When sub-classing, this defines the sub-class entity name")
      @NotNull

    public String getAtType() {
    return _atType;
  }

  public void setAtType(String _atType) {
    this._atType = _atType;
  }


  @Override
@@ -318,14 +250,14 @@ public class PriceAlteration extends BaseRootNamedEntity {
        Objects.equals(this.unitOfMeasure, priceAlteration.unitOfMeasure) &&
        Objects.equals(this.price, priceAlteration.price) &&
        Objects.equals(this.productOfferingPrice, priceAlteration.productOfferingPrice) &&
        Objects.equals(this._atBaseType, priceAlteration._atBaseType) &&
        Objects.equals(this._atSchemaLocation, priceAlteration._atSchemaLocation) &&
        Objects.equals(this._atType, priceAlteration._atType);
        Objects.equals(this.baseType, priceAlteration.baseType) &&
        Objects.equals(this.schemaLocation, priceAlteration.schemaLocation) &&
        Objects.equals(this.type, priceAlteration.type);
  }

  @Override
  public int hashCode() {
    return Objects.hash(applicationDuration, description, name, priceType, priority, recurringChargePeriod, unitOfMeasure, price, productOfferingPrice, _atBaseType, _atSchemaLocation, _atType);
    return Objects.hash(applicationDuration, description, name, priceType, priority, recurringChargePeriod, unitOfMeasure, price, productOfferingPrice, baseType, schemaLocation, type);
  }

  @Override
@@ -342,9 +274,9 @@ public class PriceAlteration extends BaseRootNamedEntity {
    sb.append("    unitOfMeasure: ").append(toIndentedString(unitOfMeasure)).append("\n");
    sb.append("    price: ").append(toIndentedString(price)).append("\n");
    sb.append("    productOfferingPrice: ").append(toIndentedString(productOfferingPrice)).append("\n");
    sb.append("    _atBaseType: ").append(toIndentedString(_atBaseType)).append("\n");
    sb.append("    _atSchemaLocation: ").append(toIndentedString(_atSchemaLocation)).append("\n");
    sb.append("    _atType: ").append(toIndentedString(_atType)).append("\n");
    sb.append("    _atBaseType: ").append(toIndentedString(baseType)).append("\n");
    sb.append("    _atSchemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
    sb.append("    _atType: ").append(toIndentedString(type)).append("\n");
    sb.append("}");
    return sb.toString();
  }
+107 −150

File changed.

Preview size limit exceeded, changes collapsed.

+30 −84
Original line number Diff line number Diff line
package org.etsi.osl.tmf.pim637.model;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.etsi.osl.tmf.common.model.BaseRootNamedEntity;
import org.etsi.osl.tmf.pcm620.model.ProductOfferingPriceRef;
import org.springframework.validation.annotation.Validated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;

@@ -17,13 +25,11 @@ import jakarta.validation.constraints.NotNull;
@Validated
@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")


public class ProductPrice   {
@Entity(name = "ProdPrice637")
public class ProductPrice  extends BaseRootNamedEntity {
  @JsonProperty("description")
  private String description = null;

  @JsonProperty("name")
  private String name = null;

  @JsonProperty("priceType")
  private String priceType = null;
@@ -35,26 +41,24 @@ public class ProductPrice {
  private String unitOfMeasure = null;

  @JsonProperty("billingAccount")
  @OneToOne(cascade = CascadeType.ALL)
  @JoinColumn(name = "billing_acc_refuuid", referencedColumnName = "uuid")
  private BillingAccountRef billingAccount = null;

  @JsonProperty("price")
  @OneToOne(cascade = CascadeType.ALL)
  @JoinColumn(name = "price_uuid", referencedColumnName = "uuid")
  private Price price = null;

  @JsonProperty("productOfferingPrice")
  @OneToOne(cascade = CascadeType.ALL)
  @JoinColumn(name = "prodoffprice_refuuid", referencedColumnName = "uuid")
  private ProductOfferingPriceRef productOfferingPrice = null;

  @JsonProperty("productPriceAlteration")
  @Valid
  private List<PriceAlteration> productPriceAlteration = null;

  @JsonProperty("@baseType")
  private String _atBaseType = null;

  @JsonProperty("@schemaLocation")
  private String _atSchemaLocation = null;

  @JsonProperty("@type")
  private String _atType = null;
  @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
  private Set<PriceAlteration> productPriceAlteration = new HashSet<>();

  public ProductPrice description(String description) {
    this.description = description;
@@ -219,14 +223,14 @@ public class ProductPrice {
    this.productOfferingPrice = productOfferingPrice;
  }

  public ProductPrice productPriceAlteration(List<PriceAlteration> productPriceAlteration) {
  public ProductPrice productPriceAlteration(Set<PriceAlteration> productPriceAlteration) {
    this.productPriceAlteration = productPriceAlteration;
    return this;
  }

  public ProductPrice addProductPriceAlterationItem(PriceAlteration productPriceAlterationItem) {
    if (this.productPriceAlteration == null) {
      this.productPriceAlteration = new ArrayList<PriceAlteration>();
      this.productPriceAlteration = new HashSet<PriceAlteration>();
    }
    this.productPriceAlteration.add(productPriceAlterationItem);
    return this;
@@ -239,73 +243,15 @@ public class ProductPrice {
  @Schema(description = "")
      @NotNull
    @Valid
    public List<PriceAlteration> getProductPriceAlteration() {
    public Set<PriceAlteration> getProductPriceAlteration() {
    return productPriceAlteration;
  }

  public void setProductPriceAlteration(List<PriceAlteration> productPriceAlteration) {
  public void setProductPriceAlteration(Set<PriceAlteration> productPriceAlteration) {
    this.productPriceAlteration = productPriceAlteration;
  }

  public ProductPrice _atBaseType(String _atBaseType) {
    this._atBaseType = _atBaseType;
    return this;
  }

  /**
   * When sub-classing, this defines the super-class
   * @return _atBaseType
   **/
  @Schema(description = "When sub-classing, this defines the super-class")
      @NotNull

    public String getAtBaseType() {
    return _atBaseType;
  }

  public void setAtBaseType(String _atBaseType) {
    this._atBaseType = _atBaseType;
  }
 
  public ProductPrice _atSchemaLocation(String _atSchemaLocation) {
    this._atSchemaLocation = _atSchemaLocation;
    return this;
  }

  /**
   * A URI to a JSON-Schema file that defines additional attributes and relationships
   * @return _atSchemaLocation
   **/
  @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships")
      @NotNull

    public String getAtSchemaLocation() {
    return _atSchemaLocation;
  }

  public void setAtSchemaLocation(String _atSchemaLocation) {
    this._atSchemaLocation = _atSchemaLocation;
  }

  public ProductPrice _atType(String _atType) {
    this._atType = _atType;
    return this;
  }

  /**
   * When sub-classing, this defines the sub-class entity name
   * @return _atType
   **/
  @Schema(description = "When sub-classing, this defines the sub-class entity name")
      @NotNull

    public String getAtType() {
    return _atType;
  }

  public void setAtType(String _atType) {
    this._atType = _atType;
  }


  @Override
@@ -326,14 +272,14 @@ public class ProductPrice {
        Objects.equals(this.price, productPrice.price) &&
        Objects.equals(this.productOfferingPrice, productPrice.productOfferingPrice) &&
        Objects.equals(this.productPriceAlteration, productPrice.productPriceAlteration) &&
        Objects.equals(this._atBaseType, productPrice._atBaseType) &&
        Objects.equals(this._atSchemaLocation, productPrice._atSchemaLocation) &&
        Objects.equals(this._atType, productPrice._atType);
        Objects.equals(this.baseType, productPrice.baseType) &&
        Objects.equals(this.schemaLocation, productPrice.schemaLocation) &&
        Objects.equals(this.baseType, productPrice.baseType);
  }

  @Override
  public int hashCode() {
    return Objects.hash(description, name, priceType, recurringChargePeriod, unitOfMeasure, billingAccount, price, productOfferingPrice, productPriceAlteration, _atBaseType, _atSchemaLocation, _atType);
    return Objects.hash(description, name, priceType, recurringChargePeriod, unitOfMeasure, billingAccount, price, productOfferingPrice, productPriceAlteration, baseType, schemaLocation, baseType);
  }

  @Override
@@ -350,9 +296,9 @@ public class ProductPrice {
    sb.append("    price: ").append(toIndentedString(price)).append("\n");
    sb.append("    productOfferingPrice: ").append(toIndentedString(productOfferingPrice)).append("\n");
    sb.append("    productPriceAlteration: ").append(toIndentedString(productPriceAlteration)).append("\n");
    sb.append("    _atBaseType: ").append(toIndentedString(_atBaseType)).append("\n");
    sb.append("    _atSchemaLocation: ").append(toIndentedString(_atSchemaLocation)).append("\n");
    sb.append("    _atType: ").append(toIndentedString(_atType)).append("\n");
    sb.append("    _atBaseType: ").append(toIndentedString(baseType)).append("\n");
    sb.append("    _atSchemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
    sb.append("    _atType: ").append(toIndentedString(baseType)).append("\n");
    sb.append("}");
    return sb.toString();
  }
+36 −850

File changed.

Preview size limit exceeded, changes collapsed.

Loading