fixes bug#9419
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@71712 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
72977fb74b
commit
561cf8250b
|
@ -0,0 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.PtovtaContaMD;
|
||||
|
||||
public interface PtovtaContaMDDAO extends GenericDAO<PtovtaContaMD, Long> {
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
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.PtovtaContaMDDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.PtovtaContaMD;
|
||||
|
||||
@Repository("PtovtaContaMDDAO")
|
||||
public class PtovtaContaMDHibernateDAO extends GenericHibernateDAO<PtovtaContaMD, Long> implements PtovtaContaMDDAO {
|
||||
|
||||
|
||||
@Autowired
|
||||
public PtovtaContaMDHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<PtovtaContaMD> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
}
|
|
@ -177,6 +177,6 @@ public class ContaMD implements Serializable {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ContaMD [contaId=" + contaId + ", nome=" + nome + ", tipo=" + tipo + ", codigoContabil=" + codigoContabil + ", docAssociado=" + docAssociado + ", cancelamento=" + cancelamento + ", status=" + status + ", origem=" + origem + ", referencia=" + referencia + ", fecmodif=" + fecmodif + ", usuarioId=" + usuarioId + ", activo=" + activo + "]";
|
||||
return getNome();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,126 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
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;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@SequenceGenerator(name = "PTOVTACONTA_SEQ", sequenceName = "PTOVTACONTA_SEQ", allocationSize = 1)
|
||||
@Table(name = "PTOVTA_CONTA")
|
||||
public class PtovtaContaMD {
|
||||
|
||||
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "PTOVTACONTA_SEQ")
|
||||
@Column(name = "PTOVTACONTA_ID")
|
||||
private Integer ptovtaContaId;
|
||||
|
||||
@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
|
||||
@ManyToOne
|
||||
private Empresa empresaId;
|
||||
|
||||
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
|
||||
@ManyToOne
|
||||
private PuntoVenta puntoventaId;
|
||||
|
||||
@JoinColumn(name = "CONTA_ID", referencedColumnName = "CONTA_ID")
|
||||
@ManyToOne
|
||||
private ContaMD contaId;
|
||||
|
||||
@Column(name = "PERCENTUAL")
|
||||
private BigDecimal percentual;
|
||||
|
||||
@Column(name = "USUARIO_ID")
|
||||
private int usuarioId;
|
||||
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
|
||||
public Integer getPtovtaContaId() {
|
||||
return ptovtaContaId;
|
||||
}
|
||||
|
||||
public void setPtovtaContaId(Integer ptovtaContaId) {
|
||||
this.ptovtaContaId = ptovtaContaId;
|
||||
}
|
||||
|
||||
public Empresa getEmpresaId() {
|
||||
return empresaId;
|
||||
}
|
||||
|
||||
public void setEmpresaId(Empresa empresaId) {
|
||||
this.empresaId = empresaId;
|
||||
}
|
||||
|
||||
public PuntoVenta getPuntoventaId() {
|
||||
return puntoventaId;
|
||||
}
|
||||
|
||||
public void setPuntoventaId(PuntoVenta puntoventaId) {
|
||||
this.puntoventaId = puntoventaId;
|
||||
}
|
||||
|
||||
public ContaMD getContaId() {
|
||||
return contaId;
|
||||
}
|
||||
|
||||
public void setContaId(ContaMD contaId) {
|
||||
this.contaId = contaId;
|
||||
}
|
||||
|
||||
public BigDecimal getPercentual() {
|
||||
return percentual;
|
||||
}
|
||||
|
||||
public void setPercentual(BigDecimal percentual) {
|
||||
this.percentual = percentual;
|
||||
}
|
||||
|
||||
public int getUsuarioId() {
|
||||
return usuarioId;
|
||||
}
|
||||
|
||||
public void setUsuarioId(int usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
public Boolean getActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(Boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PtovtaConta [ptovtaContaId=" + ptovtaContaId + ", empresaId=" + empresaId + ", puntoventaId=" + puntoventaId + ", contaId=" + contaId + ", percentual=" + percentual + ", usuarioId=" + usuarioId + ", fecmodif=" + fecmodif + ", activo=" + activo + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.PtovtaContaMD;
|
||||
|
||||
public interface PtovtaContaMDService extends GenericService<PtovtaContaMD, Long> {
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
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.PtovtaContaMDDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.PtovtaContaMD;
|
||||
import com.rjconsultores.ventaboletos.service.PtovtaContaMDService;
|
||||
|
||||
@Service("PtovtaContaMDService")
|
||||
public class PtovtaContaMDServiceImpl implements PtovtaContaMDService {
|
||||
|
||||
@Autowired
|
||||
private PtovtaContaMDDAO ptovtaContaMDDAO;
|
||||
|
||||
@Override
|
||||
public List<PtovtaContaMD> obtenerTodos() {
|
||||
return ptovtaContaMDDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PtovtaContaMD obtenerID(Long id) {
|
||||
return ptovtaContaMDDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public PtovtaContaMD suscribir(PtovtaContaMD entidad) {
|
||||
return ptovtaContaMDDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public PtovtaContaMD actualizacion(PtovtaContaMD entidad) {
|
||||
return ptovtaContaMDDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void borrar(PtovtaContaMD entidad) {
|
||||
ptovtaContaMDDAO.borrar(entidad);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue