All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.tno.bim.mapping.domain.MaterialMapping Maven / Gradle / Ivy

package nl.tno.bim.mapping.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonBackReference;

@SuppressWarnings("serial")
@Entity
@Table(name = "material_mappings")
public class MaterialMapping implements Serializable {
	@Id
	@GeneratedValue
	private Long id;

	@JsonBackReference(value = "materialmapping-1")
	@ManyToOne(fetch = FetchType.EAGER)
	private Mapping mapping;

	@Column(name = "material_name")
	private String materialName;

	@Column(name = "nmd_product_id")
	private Long nmdProductId;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Mapping getMapping() {
		return mapping;
	}

	public void setMapping(Mapping mapping) {
		this.mapping = mapping;
	}

	public String getMaterialName() {
		return materialName;
	}

	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}

	public Long getNmdProductId() {
		return nmdProductId;
	}

	public void setNmdProductId(Long nmdProductId) {
		this.nmdProductId = nmdProductId;
	}

	/**
	 * Determine if the non unique values (or other record references) of the MaterialMapping are equal to
	 * another
	 * 
	 * @param other MaterialMapping object to check against
	 * @return a flag to indicate value equality
	 */
	public boolean equalByValues(MaterialMapping other) {
		return this.getMaterialName().equals(other.getMaterialName())
				&& this.getNmdProductId() == other.getNmdProductId();

	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy