package com.fp.armas.portal.model; import java.io.Serializable; import java.util.Set; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.JoinColumns; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Version; /** * The persistent class for the TGENECANTON database table. * */ @Entity public class Tgenecanton implements Serializable { private static final long serialVersionUID = 1L; @EmbeddedId private TgenecantonPK id; private String description; @Version private Long recordversion; //bi-directional many-to-one association to Tgeneprovince @ManyToOne(fetch=FetchType.LAZY) @JoinColumns({ @JoinColumn(name="COUNTRYCODE", referencedColumnName="COUNTRYCODE"), @JoinColumn(name="PROVINCECODE", referencedColumnName="PROVINCECODE") }) private Tgeneprovince tgeneprovince; //bi-directional many-to-one association to Tgenecity @OneToMany(mappedBy="tgenecanton") private Set tgenecities; //bi-directional many-to-one association to Tgeneparroquia @OneToMany(mappedBy="tgenecanton") private Set tgeneparroquias; public Tgenecanton() { } public TgenecantonPK getId() { return this.id; } public void setId(TgenecantonPK id) { this.id = id; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public Long getRecordversion() { return this.recordversion; } public void setRecordversion(Long recordversion) { this.recordversion = recordversion; } public Tgeneprovince getTgeneprovince() { return this.tgeneprovince; } public void setTgeneprovince(Tgeneprovince tgeneprovince) { this.tgeneprovince = tgeneprovince; } public Set getTgenecities() { return this.tgenecities; } public void setTgenecities(Set tgenecities) { this.tgenecities = tgenecities; } public Tgenecity addTgenecity(Tgenecity tgenecity) { getTgenecities().add(tgenecity); tgenecity.setTgenecanton(this); return tgenecity; } public Tgenecity removeTgenecity(Tgenecity tgenecity) { getTgenecities().remove(tgenecity); tgenecity.setTgenecanton(null); return tgenecity; } public Set getTgeneparroquias() { return this.tgeneparroquias; } public void setTgeneparroquias(Set tgeneparroquias) { this.tgeneparroquias = tgeneparroquias; } public Tgeneparroquia addTgeneparroquia(Tgeneparroquia tgeneparroquia) { getTgeneparroquias().add(tgeneparroquia); tgeneparroquia.setTgenecanton(this); return tgeneparroquia; } public Tgeneparroquia removeTgeneparroquia(Tgeneparroquia tgeneparroquia) { getTgeneparroquias().remove(tgeneparroquia); tgeneparroquia.setTgenecanton(null); return tgeneparroquia; } }