#7455 Mensagem adm
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@58531 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
e70451dc24
commit
c8b5b5b3cb
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
|
||||||
|
public interface MensajeDAO extends GenericDAO<Mensaje, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajeEmpresa;
|
||||||
|
|
||||||
|
public interface MensajeEmpresaDAO extends GenericDAO<MensajeEmpresa, Integer> {
|
||||||
|
|
||||||
|
public List<MensajeEmpresa> obtenerPorMensaje(Mensaje mensaje);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajePuntoVenta;
|
||||||
|
|
||||||
|
public interface MensajePuntoVentaDAO extends GenericDAO<MensajePuntoVenta, Integer> {
|
||||||
|
|
||||||
|
public List<MensajePuntoVenta> obtenerPorMensaje(Mensaje mensaje);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajeUsuario;
|
||||||
|
|
||||||
|
public interface MensajeUsuarioDAO extends GenericDAO<MensajeUsuario, Integer> {
|
||||||
|
|
||||||
|
public List<MensajeUsuario> obtenerPorMensaje(Mensaje mensaje);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
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.MensajeEmpresaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajeEmpresa;
|
||||||
|
|
||||||
|
@Repository("MensajeEmpresaDAO")
|
||||||
|
public class MensajeEmpresaHibernateDAO extends GenericHibernateDAO<MensajeEmpresa, Integer> implements MensajeEmpresaDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SQLBuilder sqlBuilder;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public MensajeEmpresaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public List<MensajeEmpresa> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public List<MensajeEmpresa> obtenerPorMensaje(Mensaje mensaje) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("mensaje", mensaje));
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
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.MensajeDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
|
||||||
|
@Repository("MensajeDAO")
|
||||||
|
public class MensajeHibernateDAO extends GenericHibernateDAO<Mensaje, Integer> implements MensajeDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SQLBuilder sqlBuilder;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public MensajeHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public List<Mensaje> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
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.MensajePuntoVentaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajePuntoVenta;
|
||||||
|
|
||||||
|
@Repository("MensajePuntoVentaDAO")
|
||||||
|
public class MensajePuntoVentaHibernateDAO extends GenericHibernateDAO<MensajePuntoVenta, Integer> implements MensajePuntoVentaDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SQLBuilder sqlBuilder;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public MensajePuntoVentaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public List<MensajePuntoVenta> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public List<MensajePuntoVenta> obtenerPorMensaje(Mensaje mensaje) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("mensaje", mensaje));
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
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.MensajeUsuarioDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajeUsuario;
|
||||||
|
|
||||||
|
@Repository("MensajeUsuarioDAO")
|
||||||
|
public class MensajeUsuarioHibernateDAO extends GenericHibernateDAO<MensajeUsuario, Integer> implements MensajeUsuarioDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SQLBuilder sqlBuilder;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public MensajeUsuarioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public List<MensajeUsuario> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public List<MensajeUsuario> obtenerPorMensaje(Mensaje mensaje) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("mensaje", mensaje));
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,180 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
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.OneToMany;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "MENSAJE_SEQ", sequenceName = "MENSAJE_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "MENSAJE")
|
||||||
|
public class Mensaje implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Integer mensajeId;
|
||||||
|
private Date fecIni;
|
||||||
|
private Date fecFin;
|
||||||
|
private String descripcion;
|
||||||
|
private Boolean indTipo;
|
||||||
|
private Boolean activo;
|
||||||
|
private Date fecModif;
|
||||||
|
private Integer usuarioId;
|
||||||
|
private List<MensajePuntoVenta> mensajesPuntoVenda;
|
||||||
|
private List<MensajeEmpresa> mensajesEmpresa;
|
||||||
|
private List<MensajeUsuario> mensajesUsuario;
|
||||||
|
|
||||||
|
public Mensaje() {
|
||||||
|
mensajesPuntoVenda = new ArrayList<MensajePuntoVenta>();
|
||||||
|
mensajesEmpresa = new ArrayList<MensajeEmpresa>();
|
||||||
|
mensajesUsuario = new ArrayList<MensajeUsuario>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "MENSAJE_ID")
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "MENSAJE_SEQ")
|
||||||
|
@Basic(optional = false)
|
||||||
|
public Integer getMensajeId() {
|
||||||
|
return mensajeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMensajeId(Integer mensajeId) {
|
||||||
|
this.mensajeId = mensajeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "FECINI")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
public Date getFecIni() {
|
||||||
|
return fecIni;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecIni(Date fecIni) {
|
||||||
|
this.fecIni = fecIni;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "FECFIN")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
public Date getFecFin() {
|
||||||
|
return fecFin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecFin(Date fecFin) {
|
||||||
|
this.fecFin = fecFin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "DESCRIPCION")
|
||||||
|
public String getDescripcion() {
|
||||||
|
return descripcion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescripcion(String descripcion) {
|
||||||
|
this.descripcion = descripcion;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "INDTIPO")
|
||||||
|
public Boolean getIndTipo() {
|
||||||
|
return indTipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndTipo(Boolean indTipo) {
|
||||||
|
this.indTipo = indTipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
public Date getFecModif() {
|
||||||
|
return fecModif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecModif(Date fecModif) {
|
||||||
|
this.fecModif = fecModif;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "MENSAJE_ID", referencedColumnName = "MENSAJE_ID")
|
||||||
|
public List<MensajePuntoVenta> getMensajesPuntoVenda() {
|
||||||
|
return mensajesPuntoVenda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMensajesPuntoVenda(List<MensajePuntoVenta> mensajesPuntoVenda) {
|
||||||
|
this.mensajesPuntoVenda = mensajesPuntoVenda;
|
||||||
|
}
|
||||||
|
|
||||||
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "MENSAJE_ID", referencedColumnName = "MENSAJE_ID")
|
||||||
|
public List<MensajeEmpresa> getMensajesEmpresa() {
|
||||||
|
return mensajesEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMensajesEmpresa(List<MensajeEmpresa> mensajesEmpresa) {
|
||||||
|
this.mensajesEmpresa = mensajesEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "MENSAJE_ID", referencedColumnName = "MENSAJE_ID")
|
||||||
|
public List<MensajeUsuario> getMensajesUsuario() {
|
||||||
|
return mensajesUsuario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMensajesUsuario(List<MensajeUsuario> mensajesUsuario) {
|
||||||
|
this.mensajesUsuario = mensajesUsuario;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return mensajeId == null ? "null" : this.mensajeId.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 0;
|
||||||
|
hash += (mensajeId != null ? mensajeId.hashCode() : 0);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object object) {
|
||||||
|
if (!(object instanceof Mensaje)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Mensaje other = (Mensaje) object;
|
||||||
|
if ((this.mensajeId == null && other.mensajeId != null) || (this.mensajeId != null && !this.mensajeId.equals(other.mensajeId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,117 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
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 = "MENSAJE_EMPRESA_SEQ", sequenceName = "MENSAJE_EMPRESA_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "MENSAJE_EMPRESA")
|
||||||
|
public class MensajeEmpresa implements Serializable{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Integer mensajeEmpresaId;
|
||||||
|
private Mensaje mensaje;
|
||||||
|
private Empresa empresa;
|
||||||
|
private Boolean activo;
|
||||||
|
private Date fecModif;
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "MENSAJE_EMPRESA_ID")
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "MENSAJE_EMPRESA_SEQ")
|
||||||
|
@Basic(optional = false)
|
||||||
|
public Integer getMensajeEmpresaId() {
|
||||||
|
return mensajeEmpresaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMensajeEmpresaId(Integer mensajeEmpresaId) {
|
||||||
|
this.mensajeEmpresaId = mensajeEmpresaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "MENSAJE_ID", referencedColumnName = "MENSAJE_ID")
|
||||||
|
public Mensaje getMensaje() {
|
||||||
|
return mensaje;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMensaje(Mensaje mensaje) {
|
||||||
|
this.mensaje = mensaje;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
public Date getFecModif() {
|
||||||
|
return fecModif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecModif(Date fecModif) {
|
||||||
|
this.fecModif = fecModif;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return mensajeEmpresaId == null ? "null" : this.mensajeEmpresaId.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 0;
|
||||||
|
hash += (mensajeEmpresaId != null ? mensajeEmpresaId.hashCode() : 0);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object object) {
|
||||||
|
if (!(object instanceof MensajeEmpresa)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
MensajeEmpresa other = (MensajeEmpresa) object;
|
||||||
|
if ((this.mensajeEmpresaId == null && other.mensajeEmpresaId != null) || (this.mensajeEmpresaId != null && !this.mensajeEmpresaId.equals(other.mensajeEmpresaId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,117 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
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 = "MENSAJE_PUNTO_VENTA_SEQ", sequenceName = "MENSAJE_PUNTO_VENTA_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "MENSAJE_PUNTO_VENTA")
|
||||||
|
public class MensajePuntoVenta implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Integer mensajePuntoVendaId;
|
||||||
|
private Mensaje mensaje;
|
||||||
|
private PuntoVenta puntoVenda;
|
||||||
|
private Boolean activo;
|
||||||
|
private Date fecModif;
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "MENSAJE_PUNTO_VENTA_ID")
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "MENSAJE_PUNTO_VENTA_SEQ")
|
||||||
|
@Basic(optional = false)
|
||||||
|
public Integer getMensajePuntoVendaId() {
|
||||||
|
return mensajePuntoVendaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMensajePuntoVendaId(Integer mensajePuntoVendaId) {
|
||||||
|
this.mensajePuntoVendaId = mensajePuntoVendaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "MENSAJE_ID", referencedColumnName = "MENSAJE_ID")
|
||||||
|
public Mensaje getMensaje() {
|
||||||
|
return mensaje;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMensaje(Mensaje mensaje) {
|
||||||
|
this.mensaje = mensaje;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
|
||||||
|
public PuntoVenta getPuntoVenda() {
|
||||||
|
return puntoVenda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPuntoVenda(PuntoVenta puntoVenda) {
|
||||||
|
this.puntoVenda = puntoVenda;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
public Date getFecModif() {
|
||||||
|
return fecModif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecModif(Date fecModif) {
|
||||||
|
this.fecModif = fecModif;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return mensajePuntoVendaId == null ? "null" : this.mensajePuntoVendaId.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 0;
|
||||||
|
hash += (mensajePuntoVendaId != null ? mensajePuntoVendaId.hashCode() : 0);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object object) {
|
||||||
|
if (!(object instanceof MensajePuntoVenta)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
MensajePuntoVenta other = (MensajePuntoVenta) object;
|
||||||
|
if ((this.mensajePuntoVendaId == null && other.mensajePuntoVendaId != null) || (this.mensajePuntoVendaId != null && !this.mensajePuntoVendaId.equals(other.mensajePuntoVendaId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,125 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
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 = "MENSAJE_USUARIO_SEQ", sequenceName = "MENSAJE_USUARIO_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "MENSAJE_USUARIO")
|
||||||
|
public class MensajeUsuario {
|
||||||
|
|
||||||
|
private Integer mensajeUsuarioId;
|
||||||
|
private Mensaje mensaje;
|
||||||
|
private Usuario usuario;
|
||||||
|
private Date fecLeido;
|
||||||
|
private Date fecModif;
|
||||||
|
private Boolean activo;
|
||||||
|
private Integer usuarioModifId;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "MENSAJE_USUARIO_ID")
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "MENSAJE_USUARIO_SEQ")
|
||||||
|
@Basic(optional = false)
|
||||||
|
public Integer getMensajeUsuarioId() {
|
||||||
|
return mensajeUsuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMensajeUsuarioId(Integer mensajeUsuarioId) {
|
||||||
|
this.mensajeUsuarioId = mensajeUsuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "MENSAJE_ID", referencedColumnName = "MENSAJE_ID")
|
||||||
|
public Mensaje getMensaje() {
|
||||||
|
return mensaje;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMensaje(Mensaje mensaje) {
|
||||||
|
this.mensaje = mensaje;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "USUARIO_ID", referencedColumnName = "USUARIO_ID")
|
||||||
|
public Usuario getUsuario() {
|
||||||
|
return usuario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuario(Usuario usuario) {
|
||||||
|
this.usuario = usuario;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "FECLEIDO")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
public Date getFecLeido() {
|
||||||
|
return fecLeido;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecLeido(Date fecLeido) {
|
||||||
|
this.fecLeido = fecLeido;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
public Date getFecModif() {
|
||||||
|
return fecModif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecModif(Date fecModif) {
|
||||||
|
this.fecModif = fecModif;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "USUARIOMODIF_ID ")
|
||||||
|
public Integer getUsuarioModifId() {
|
||||||
|
return usuarioModifId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioModifId(Integer usuarioModifId) {
|
||||||
|
this.usuarioModifId = usuarioModifId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return mensajeUsuarioId == null ? "null" : this.mensajeUsuarioId.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 0;
|
||||||
|
hash += (mensajeUsuarioId != null ? mensajeUsuarioId.hashCode() : 0);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object object) {
|
||||||
|
if (!(object instanceof MensajeUsuario)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
MensajeUsuario other = (MensajeUsuario) object;
|
||||||
|
if ((this.mensajeUsuarioId == null && other.mensajeUsuarioId != null) || (this.mensajeUsuarioId != null && !this.mensajeUsuarioId.equals(other.mensajeUsuarioId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajeEmpresa;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
|
||||||
|
public interface MensajeEmpresaService {
|
||||||
|
|
||||||
|
public List<MensajeEmpresa> obtenerTodos();
|
||||||
|
|
||||||
|
public List<MensajeEmpresa> obtenerPorMensaje(Mensaje mensaje);
|
||||||
|
|
||||||
|
public MensajeEmpresa obtenerID(Integer id);
|
||||||
|
|
||||||
|
public void borrar(MensajeEmpresa entidad);
|
||||||
|
|
||||||
|
public MensajeEmpresa suscribirActualizar(MensajeEmpresa entidad) throws BusinessException;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajePuntoVenta;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
|
||||||
|
public interface MensajePuntaVentaService {
|
||||||
|
|
||||||
|
public List<MensajePuntoVenta> obtenerTodos();
|
||||||
|
|
||||||
|
public List<MensajePuntoVenta> obtenerPorMensaje(Mensaje mensaje);
|
||||||
|
|
||||||
|
public MensajePuntoVenta obtenerID(Integer id);
|
||||||
|
|
||||||
|
public void borrar(MensajePuntoVenta entidad);
|
||||||
|
|
||||||
|
public MensajePuntoVenta suscribirActualizar(MensajePuntoVenta entidad) throws BusinessException;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
|
||||||
|
public interface MensajeService {
|
||||||
|
|
||||||
|
public List<Mensaje> obtenerTodos();
|
||||||
|
|
||||||
|
public Mensaje obtenerID(Integer id);
|
||||||
|
|
||||||
|
public void borrar(Mensaje entidad);
|
||||||
|
|
||||||
|
public Mensaje suscribirActualizar(Mensaje entidad) throws BusinessException;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajeUsuario;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
|
||||||
|
public interface MensajeUsuarioService {
|
||||||
|
|
||||||
|
public List<MensajeUsuario> obtenerTodos();
|
||||||
|
|
||||||
|
public List<MensajeUsuario> obtenerPorMensaje(Mensaje mensaje);
|
||||||
|
|
||||||
|
public MensajeUsuario obtenerID(Integer id);
|
||||||
|
|
||||||
|
public void borrar(MensajeUsuario entidad);
|
||||||
|
|
||||||
|
public MensajeUsuario suscribirActualizar(MensajeUsuario entidad) throws BusinessException;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
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.MensajeEmpresaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajeEmpresa;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
import com.rjconsultores.ventaboletos.service.MensajeEmpresaService;
|
||||||
|
|
||||||
|
@Service("mensajeEmpresaService")
|
||||||
|
public class MensajeEmpresaServiceImpl implements MensajeEmpresaService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MensajeEmpresaDAO mensajeEmpresaDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MensajeEmpresa> obtenerTodos() {
|
||||||
|
return mensajeEmpresaDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MensajeEmpresa obtenerID(Integer id) {
|
||||||
|
return mensajeEmpresaDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
|
public void borrar(MensajeEmpresa entidad) {
|
||||||
|
mensajeEmpresaDAO.borrar(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
|
public MensajeEmpresa suscribirActualizar(MensajeEmpresa entidad) throws BusinessException {
|
||||||
|
if (entidad.getMensajeEmpresaId() == null) {
|
||||||
|
return mensajeEmpresaDAO.suscribir(entidad);
|
||||||
|
} else {
|
||||||
|
return mensajeEmpresaDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MensajeEmpresa> obtenerPorMensaje(Mensaje mensaje) {
|
||||||
|
return mensajeEmpresaDAO.obtenerPorMensaje(mensaje);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
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.MensajePuntoVentaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajePuntoVenta;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
import com.rjconsultores.ventaboletos.service.MensajePuntaVentaService;
|
||||||
|
|
||||||
|
@Service("mensajePuntoVentaService")
|
||||||
|
public class MensajePuntoVentaServiceImpl implements MensajePuntaVentaService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MensajePuntoVentaDAO mensajePuntoVentaDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MensajePuntoVenta> obtenerTodos() {
|
||||||
|
return mensajePuntoVentaDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MensajePuntoVenta obtenerID(Integer id) {
|
||||||
|
return mensajePuntoVentaDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
|
public void borrar(MensajePuntoVenta entidad) {
|
||||||
|
mensajePuntoVentaDAO.borrar(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
|
public MensajePuntoVenta suscribirActualizar(MensajePuntoVenta entidad) throws BusinessException {
|
||||||
|
if (entidad.getMensajePuntoVendaId() == null) {
|
||||||
|
return mensajePuntoVentaDAO.suscribir(entidad);
|
||||||
|
} else {
|
||||||
|
return mensajePuntoVentaDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MensajePuntoVenta> obtenerPorMensaje(Mensaje mensaje) {
|
||||||
|
return mensajePuntoVentaDAO.obtenerPorMensaje(mensaje);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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.MensajeDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
import com.rjconsultores.ventaboletos.service.MensajeService;
|
||||||
|
|
||||||
|
@Service("mensajeService")
|
||||||
|
public class MensajeServiceImpl implements MensajeService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MensajeDAO mensajeDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Mensaje> obtenerTodos() {
|
||||||
|
return mensajeDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mensaje obtenerID(Integer id) {
|
||||||
|
return mensajeDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
|
public void borrar(Mensaje entidad) {
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
mensajeDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
|
public Mensaje suscribirActualizar(Mensaje entidad) throws BusinessException {
|
||||||
|
if (entidad.getMensajeId() == null) {
|
||||||
|
return mensajeDAO.suscribir(entidad);
|
||||||
|
} else {
|
||||||
|
return mensajeDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
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.MensajeUsuarioDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MensajeUsuario;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
import com.rjconsultores.ventaboletos.service.MensajeUsuarioService;
|
||||||
|
|
||||||
|
@Service("mensajeUsuarioService")
|
||||||
|
public class MensajeUsuarioServiceImpl implements MensajeUsuarioService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MensajeUsuarioDAO mensajeUsuarioDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MensajeUsuario> obtenerTodos() {
|
||||||
|
return mensajeUsuarioDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MensajeUsuario obtenerID(Integer id) {
|
||||||
|
return mensajeUsuarioDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
|
public void borrar(MensajeUsuario entidad) {
|
||||||
|
mensajeUsuarioDAO.borrar(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
|
public MensajeUsuario suscribirActualizar(MensajeUsuario entidad) throws BusinessException {
|
||||||
|
if (entidad.getMensajeUsuarioId() == null) {
|
||||||
|
return mensajeUsuarioDAO.suscribir(entidad);
|
||||||
|
} else {
|
||||||
|
return mensajeUsuarioDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MensajeUsuario> obtenerPorMensaje(Mensaje mensaje) {
|
||||||
|
return mensajeUsuarioDAO.obtenerPorMensaje(mensaje);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue