leonardo 2017-05-24 21:08:12 +00:00
parent 4b3cc6624f
commit 6e38275a5b
6 changed files with 165 additions and 0 deletions

View File

@ -0,0 +1,7 @@
package com.rjconsultores.ventaboletos.dao;
import com.rjconsultores.ventaboletos.entidad.CategoriaBloqueioImpPosterior;
public interface CategoriaBloqueioImpPosteriorDAO extends GenericDAO<CategoriaBloqueioImpPosterior, Integer> {
}

View File

@ -0,0 +1,19 @@
package com.rjconsultores.ventaboletos.dao.hibernate;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import com.rjconsultores.ventaboletos.dao.CategoriaBloqueioImpPosteriorDAO;
import com.rjconsultores.ventaboletos.entidad.CategoriaBloqueioImpPosterior;
@Repository("categoriaBloqueioImpPosteriorDAO")
public class CategoriaBloqueioImpPosteriorHibernateDAO extends GenericHibernateDAO<CategoriaBloqueioImpPosterior, Integer>
implements CategoriaBloqueioImpPosteriorDAO {
@Autowired
public CategoriaBloqueioImpPosteriorHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
setSessionFactory(factory);
}
}

View File

@ -0,0 +1,68 @@
package com.rjconsultores.ventaboletos.entidad;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@Entity
@SequenceGenerator(name = "CAT_BLOQ_IMPPOSTERIOR_SEQ", sequenceName = "CAT_BLOQ_IMPPOSTERIOR_SEQ", allocationSize = 1)
@Table(name = "CATEGORIA_BLOQ_IMPPOSTERIOR")
public class CategoriaBloqueioImpPosterior {
@Id
@Basic(optional = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CAT_BLOQ_IMPPOSTERIOR_SEQ")
@Column(name = "CATBLOQUEIOIMPPOSTERIOR_ID")
private Integer categoriaBloqueioImpPosteriorId;
@ManyToOne()
@JoinColumn(name = "PUNTOVENTA_ID")
private PuntoVenta puntoventa;
@ManyToOne()
@JoinColumn(name = "CATEGORIA_ID")
private Categoria categoria;
public Integer getCategoriaBloqueioImpPosteriorId() {
return categoriaBloqueioImpPosteriorId;
}
public void setCategoriaBloqueioImpPosteriorId(Integer categoriaBloqueioImpPosteriorId) {
this.categoriaBloqueioImpPosteriorId = categoriaBloqueioImpPosteriorId;
}
public PuntoVenta getPuntoventa() {
return puntoventa;
}
public void setPuntoventa(PuntoVenta puntoventa) {
this.puntoventa = puntoventa;
}
public Categoria getCategoria() {
return categoria;
}
public void setCategoria(Categoria categoria) {
this.categoria = categoria;
}
@Override
public int hashCode() {
int hash = 0;
hash += (categoriaBloqueioImpPosteriorId != null ? categoriaBloqueioImpPosteriorId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
if (!(object instanceof CategoriaBloqueioImpPosterior)) {
return false;
}
CategoriaBloqueioImpPosterior other = (CategoriaBloqueioImpPosterior) object;
if ((this.categoriaBloqueioImpPosteriorId == null && other.categoriaBloqueioImpPosteriorId != null) || (this.categoriaBloqueioImpPosteriorId != null && !this.categoriaBloqueioImpPosteriorId.equals(other.categoriaBloqueioImpPosteriorId))) {
return false;
}
return true;
}
}

View File

@ -216,6 +216,10 @@ public class PuntoVenta implements Serializable {
@LazyCollection(LazyCollectionOption.FALSE) @LazyCollection(LazyCollectionOption.FALSE)
private List<HistoricoPuntoVenta> historicoPuntoVentaList; private List<HistoricoPuntoVenta> historicoPuntoVentaList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "puntoventa")
@LazyCollection(LazyCollectionOption.FALSE)
private List<CategoriaBloqueioImpPosterior> categoriaBloqImpPosteriorList;
public PtovtaEmpresaBloqueada addEmpresaBloqueada(Empresa e) { public PtovtaEmpresaBloqueada addEmpresaBloqueada(Empresa e) {
PtovtaEmpresaBloqueada eb = new PtovtaEmpresaBloqueada(); PtovtaEmpresaBloqueada eb = new PtovtaEmpresaBloqueada();
eb.setEmpresa(e); eb.setEmpresa(e);
@ -960,4 +964,20 @@ public class PuntoVenta implements Serializable {
public void setHistoricoPuntoVentaList(List<HistoricoPuntoVenta> historicoPuntoVentaList) { public void setHistoricoPuntoVentaList(List<HistoricoPuntoVenta> historicoPuntoVentaList) {
this.historicoPuntoVentaList = historicoPuntoVentaList; this.historicoPuntoVentaList = historicoPuntoVentaList;
} }
public List<CategoriaBloqueioImpPosterior> getCategoriaBloqImpPosteriorList() {
return categoriaBloqImpPosteriorList;
}
public void setCategoriaBloqImpPosteriorList(List<CategoriaBloqueioImpPosterior> categoriaBloqImpPosteriorList) {
this.categoriaBloqImpPosteriorList = categoriaBloqImpPosteriorList;
}
public void addCategoriaBloqImpPosterior(CategoriaBloqueioImpPosterior cat){
this.categoriaBloqImpPosteriorList.add(cat);
}
public void removeCategoriaBloqImpPosterior(CategoriaBloqueioImpPosterior cat){
this.categoriaBloqImpPosteriorList.remove(cat);
}
} }

View File

@ -0,0 +1,7 @@
package com.rjconsultores.ventaboletos.service;
import com.rjconsultores.ventaboletos.entidad.CategoriaBloqueioImpPosterior;
public interface CategoriaBloqueioImpPosteriorService extends GenericService<CategoriaBloqueioImpPosterior, Integer> {
}

View File

@ -0,0 +1,44 @@
package com.rjconsultores.ventaboletos.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.CategoriaBloqueioImpPosteriorDAO;
import com.rjconsultores.ventaboletos.entidad.CategoriaBloqueioImpPosterior;
import com.rjconsultores.ventaboletos.service.CategoriaBloqueioImpPosteriorService;
@Service("categoriaBloqueioImpPosteriorService")
public class CategoriaBloqueioImpPosteriorServiceImpl implements CategoriaBloqueioImpPosteriorService {
@Autowired
private CategoriaBloqueioImpPosteriorDAO categoriaDAO;
public List<CategoriaBloqueioImpPosterior> obtenerTodos() {
return categoriaDAO.obtenerTodos();
}
public CategoriaBloqueioImpPosterior obtenerID(Integer id) {
return categoriaDAO.obtenerID(id);
}
@Transactional
public CategoriaBloqueioImpPosterior suscribir(CategoriaBloqueioImpPosterior entidad) {
return categoriaDAO.suscribir(entidad);
}
@Transactional
public CategoriaBloqueioImpPosterior actualizacion(CategoriaBloqueioImpPosterior entidad) {
return categoriaDAO.actualizacion(entidad);
}
@Transactional
public void borrar(CategoriaBloqueioImpPosterior entidad) {
categoriaDAO.borrar(entidad);
}
}