// Path: src/main/java/org/javiermf/features/exceptions/ObjectNotFoundException.java
// public class ObjectNotFoundException extends RuntimeException {
//     public ObjectNotFoundException(String productName) {
//         super(String.format("Object with id %s has not been found", productName));
//     }
// }
// 
// Path: src/main/java/org/javiermf/features/models/constraints/FeatureConstraint.java
// @Entity
// @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
// public abstract class FeatureConstraint {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.SEQUENCE)
//     Long id;
// 
//     @ManyToOne
//     Product forProduct;
// 
//     public abstract String getType();
// 
//     public abstract EvaluationResult evaluateConfiguration(EvaluationResult currentResult, ProductConfiguration configuration);
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public void setForProduct(Product forProduct) {
//         this.forProduct = forProduct;
//     }
// }


import com.fasterxml.jackson.annotation.JsonProperty;
import org.javiermf.features.exceptions.ObjectNotFoundException;
import org.javiermf.features.models.constraints.FeatureConstraint;
import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;
package org.javiermf.features.models;




@Entity
public class Product {

    @Id
    @GeneratedValue
    Long id;

    @Column(nullable = false)
    String name;

    @OneToMany(mappedBy = "product", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    Set<Feature> productFeatures = new HashSet<Feature>();

    @OneToMany(mappedBy = "forProduct", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
// Path: src/main/java/org/javiermf/features/exceptions/ObjectNotFoundException.java
// public class ObjectNotFoundException extends RuntimeException {
//     public ObjectNotFoundException(String productName) {
//         super(String.format("Object with id %s has not been found", productName));
//     }
// }
// 
// Path: src/main/java/org/javiermf/features/models/constraints/FeatureConstraint.java
// @Entity
// @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
// public abstract class FeatureConstraint {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.SEQUENCE)
//     Long id;
// 
//     @ManyToOne
//     Product forProduct;
// 
//     public abstract String getType();
// 
//     public abstract EvaluationResult evaluateConfiguration(EvaluationResult currentResult, ProductConfiguration configuration);
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public void setForProduct(Product forProduct) {
//         this.forProduct = forProduct;
//     }
// }


// Path: src/main/java/org/javiermf/features/models/Product.java
import com.fasterxml.jackson.annotation.JsonProperty;
import org.javiermf.features.exceptions.ObjectNotFoundException;
import org.javiermf.features.models.constraints.FeatureConstraint;
import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

package org.javiermf.features.models;




@Entity
public class Product {

    @Id
    @GeneratedValue
    Long id;

    @Column(nullable = false)
    String name;

    @OneToMany(mappedBy = "product", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    Set<Feature> productFeatures = new HashSet<Feature>();

    @OneToMany(mappedBy = "forProduct", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    Set<FeatureConstraint> productFeatureConstraints = new HashSet<FeatureConstraint>();