com.alogient.cameleon.sdk.content.dao.model.Option Maven / Gradle / Ivy
The newest version!
package com.alogient.cameleon.sdk.content.dao.model;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
* The navigation is used to organise the pages into a tree structure. One must
* be carefull not to mistake this navigation into the structure for a menu.
* Altho it can be used as a menu, it is not the recommanded best practice.
*
* @author alord
*/
@Entity
@Table(name = "Options")
public class Option implements Serializable {
/**
* Serial version unique identifier
*/
private static final long serialVersionUID = 2089900631060879723L;
/**
* The primary key for this object
*/
private Integer optionId;
/**
* The parent part
*/
private Part part;
/**
* The option name
*/
private String name;
/**
* The cultures for this option
*/
private Set optionCultures;
/**
* @return the optionId
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "OptionID", nullable = false)
public Integer getOptionId() {
return optionId;
}
/**
* @param optionId the optionId to set
*/
public void setOptionId(Integer optionId) {
this.optionId = optionId;
}
/**
* @return the template
*/
@ManyToOne(fetch = FetchType.LAZY, optional = false, cascade = CascadeType.ALL)
@JoinColumn(name = "PartID")
public Part getPart() {
return part;
}
/**
* @param part the part to set
*/
public void setPart(Part part) {
this.part = part;
}
/**
* @return the name
*/
@Column(name = "OptionName", nullable = false)
@Basic(optional = false)
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the optionCultures
*/
@OneToMany(fetch = FetchType.LAZY, mappedBy = "option", cascade = CascadeType.ALL)
public Set getOptionCultures() {
return optionCultures;
}
/**
* @param optionCultures the optionCultures to set
*/
public void setOptionCultures(Set optionCultures) {
this.optionCultures = optionCultures;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy