fixes bug #9088
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@69284 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
4b3cc6624f
commit
6e38275a5b
|
@ -0,0 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaBloqueioImpPosterior;
|
||||
|
||||
public interface CategoriaBloqueioImpPosteriorDAO extends GenericDAO<CategoriaBloqueioImpPosterior, Integer> {
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -216,6 +216,10 @@ public class PuntoVenta implements Serializable {
|
|||
@LazyCollection(LazyCollectionOption.FALSE)
|
||||
private List<HistoricoPuntoVenta> historicoPuntoVentaList;
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "puntoventa")
|
||||
@LazyCollection(LazyCollectionOption.FALSE)
|
||||
private List<CategoriaBloqueioImpPosterior> categoriaBloqImpPosteriorList;
|
||||
|
||||
public PtovtaEmpresaBloqueada addEmpresaBloqueada(Empresa e) {
|
||||
PtovtaEmpresaBloqueada eb = new PtovtaEmpresaBloqueada();
|
||||
eb.setEmpresa(e);
|
||||
|
@ -960,4 +964,20 @@ public class PuntoVenta implements Serializable {
|
|||
public void setHistoricoPuntoVentaList(List<HistoricoPuntoVenta> 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaBloqueioImpPosterior;
|
||||
|
||||
public interface CategoriaBloqueioImpPosteriorService extends GenericService<CategoriaBloqueioImpPosterior, Integer> {
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue