bug #7438
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@55771 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
6cf723ff85
commit
91ec5021a1
|
@ -0,0 +1,10 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtraEmpresa;
|
||||
|
||||
public interface TipoEventoExtraEmpresaDAO extends GenericDAO<TipoEventoExtraEmpresa, Integer> {
|
||||
public List<TipoEventoExtraEmpresa> buscarPorTipoEventoExtra(TipoEventoExtra tipoeventoextra);
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.TipoEventoExtraEmpresaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtraEmpresa;
|
||||
|
||||
@Repository("tipoEventoExtraEmpresaDAO")
|
||||
public class TipoEventoExtraEmpresaHibernateDAO extends GenericHibernateDAO<TipoEventoExtraEmpresa, Integer> implements
|
||||
TipoEventoExtraEmpresaDAO {
|
||||
|
||||
@Autowired
|
||||
public TipoEventoExtraEmpresaHibernateDAO (
|
||||
@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TipoEventoExtraEmpresa> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TipoEventoExtraEmpresa> buscarPorTipoEventoExtra(TipoEventoExtra tipoeventoextra) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("tipoeventoextra", tipoeventoextra));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
}
|
|
@ -6,16 +6,21 @@ package com.rjconsultores.ventaboletos.entidad;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
|
@ -85,7 +90,9 @@ public class TipoEventoExtra implements Serializable {
|
|||
private String natureza;
|
||||
@Column(name = "CONTACONTABIL")
|
||||
private String contaContabil;
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "TIPOEVENTOEXTRA_ID", referencedColumnName = "TIPOEVENTOEXTRA_ID")
|
||||
private List<TipoEventoExtraEmpresa> empresas;
|
||||
@Column(name = "INDCONFERENCIAFISICACOMISSAO")
|
||||
private Boolean indconferenciafisicacomissao;
|
||||
|
||||
|
@ -122,6 +129,16 @@ public class TipoEventoExtra implements Serializable {
|
|||
private ParamArticulo paramArticulo2;
|
||||
|
||||
public TipoEventoExtra() {
|
||||
empresas = new ArrayList<TipoEventoExtraEmpresa>();
|
||||
}
|
||||
|
||||
public void addTipoEventoExtraEmpresa(TipoEventoExtraEmpresa tipoEventoExtraEmpresa){
|
||||
tipoEventoExtraEmpresa.setTipoeventoextra(this);
|
||||
empresas.add(tipoEventoExtraEmpresa);
|
||||
}
|
||||
|
||||
public void removeTipoEventoExtraEmpresa(TipoEventoExtraEmpresa tipoEventoExtraEmpresa){
|
||||
empresas.remove(tipoEventoExtraEmpresa);
|
||||
}
|
||||
|
||||
public TipoEventoExtra(Integer tipoeventoextraId) {
|
||||
|
@ -340,4 +357,12 @@ public class TipoEventoExtra implements Serializable {
|
|||
this.indconferenciafisicacomissao = indconferenciafisicacomissao;
|
||||
}
|
||||
|
||||
public List<TipoEventoExtraEmpresa> getEmpresas() {
|
||||
return empresas;
|
||||
}
|
||||
|
||||
public void setEmpresas(List<TipoEventoExtraEmpresa> empresas) {
|
||||
this.empresas = empresas;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
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
|
||||
@Table(name = "TIPO_EVENTO_EXTRA_EMPRESA")
|
||||
@SequenceGenerator(name = "TIPO_EVENTO_EXTRA_EMPRESA_SEQ", sequenceName = "TIPO_EVENTO_EXTRA_EMPRESA_SEQ", allocationSize = 1)
|
||||
public class TipoEventoExtraEmpresa {
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_EVENTO_EXTRA_EMPRESA_SEQ")
|
||||
@Column(name = "TIPOEVENTOEXTRAEMPRESA_ID")
|
||||
private Integer tipoeventoextraempresaId;
|
||||
@JoinColumn(name = "TIPOEVENTOEXTRA_ID")
|
||||
@ManyToOne
|
||||
private TipoEventoExtra tipoeventoextra;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "EMPRESA_ID")
|
||||
private Empresa empresa;
|
||||
|
||||
public Integer getTipoeventoextraempresaId() {
|
||||
return tipoeventoextraempresaId;
|
||||
}
|
||||
public void setTipoeventoextraempresaId(Integer tipoeventoextraempresaId) {
|
||||
this.tipoeventoextraempresaId = tipoeventoextraempresaId;
|
||||
}
|
||||
public TipoEventoExtra getTipoeventoextra() {
|
||||
return tipoeventoextra;
|
||||
}
|
||||
public void setTipoeventoextra(TipoEventoExtra tipoeventoextra) {
|
||||
this.tipoeventoextra = tipoeventoextra;
|
||||
}
|
||||
public Empresa getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
public void setEmpresa(Empresa empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return empresa.getNombempresa();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtraEmpresa;
|
||||
import com.rjconsultores.ventaboletos.exception.ValidacionCampoException;
|
||||
|
||||
public interface TipoEventoExtraEmpresaService {
|
||||
public List<TipoEventoExtraEmpresa> buscarPorTipoEventoExtra(TipoEventoExtra tipoeventoextra);
|
||||
public TipoEventoExtraEmpresa suscribir(TipoEventoExtraEmpresa entidad);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.TipoEventoExtraEmpresaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtraEmpresa;
|
||||
import com.rjconsultores.ventaboletos.service.TipoEventoExtraEmpresaService;
|
||||
|
||||
@Service("tipoEventoExtraEmpresaService")
|
||||
public class TipoEventoExtraEmpresaServiceImpl implements TipoEventoExtraEmpresaService {
|
||||
@Autowired
|
||||
private TipoEventoExtraEmpresaDAO tipoEventoExtraEmpresaDAO;
|
||||
|
||||
@Override
|
||||
public List<TipoEventoExtraEmpresa> buscarPorTipoEventoExtra(TipoEventoExtra tipoeventoextra) {
|
||||
return tipoEventoExtraEmpresaDAO.buscarPorTipoEventoExtra(tipoeventoextra);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TipoEventoExtraEmpresa suscribir(TipoEventoExtraEmpresa entidad) {
|
||||
return tipoEventoExtraEmpresaDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue