fixes bug #6332
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@44257 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
626443e759
commit
0abba6cfc9
|
@ -6,6 +6,7 @@ package com.rjconsultores.ventaboletos.dao;
|
|||
|
||||
import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
||||
import com.rjconsultores.ventaboletos.entidad.Colonia;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -16,5 +17,6 @@ public interface ColoniaDAO extends GenericDAO<Colonia, Integer> {
|
|||
|
||||
public List<Colonia> buscar(String desccolonia);
|
||||
public List<Colonia> buscarPorCiudad(Ciudad ciudad);
|
||||
public List<Colonia> buscaLike(String desccolonia);
|
||||
public List<Colonia> buscarPorCodMun(Ciudad ciudad, String desccolonia);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Hotel;
|
||||
|
||||
public interface HotelDAO extends GenericDAO<Hotel, Integer> {
|
||||
|
||||
public List<Hotel> buscar(String deschotel);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.PrecoApanhe;
|
||||
|
||||
public interface PrecoApanheDAO extends GenericDAO<PrecoApanhe, Integer> {
|
||||
|
||||
public List<PrecoApanhe> buscar(String deschotel, String desccolonia, String nombciudad);
|
||||
}
|
|
@ -7,7 +7,10 @@ package com.rjconsultores.ventaboletos.dao.hibernate;
|
|||
import com.rjconsultores.ventaboletos.dao.ColoniaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
||||
import com.rjconsultores.ventaboletos.entidad.Colonia;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.criterion.MatchMode;
|
||||
import org.hibernate.criterion.Order;
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.SessionFactory;
|
||||
|
@ -53,6 +56,16 @@ public class ColoniaHibernateDAO extends GenericHibernateDAO<Colonia, Integer>
|
|||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Colonia> buscaLike(String desccolonia) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.like("desccolonia", desccolonia, MatchMode.START));
|
||||
c.addOrder(Order.asc("desccolonia"));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Colonia> buscarPorCodMun(Ciudad ciudad, String desccolonia) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
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.HotelDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Hotel;
|
||||
|
||||
@Repository("hotelDAO")
|
||||
public class HotelHibernateDAO extends GenericHibernateDAO<Hotel, Integer> implements HotelDAO {
|
||||
|
||||
@Autowired
|
||||
public HotelHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Hotel> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
public List<Hotel> buscar(String deschotel) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
c.add(Restrictions.eq("deschotel", deschotel));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
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.PrecoApanheDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.PrecoApanhe;
|
||||
|
||||
@Repository("precoApanheDAO")
|
||||
public class PrecoApanheHibernateDAO extends GenericHibernateDAO<PrecoApanhe, Integer> implements PrecoApanheDAO {
|
||||
|
||||
@Autowired
|
||||
public PrecoApanheHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<PrecoApanhe> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<PrecoApanhe> buscar(String deschotel, String desccolonia, String nombciudad) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
if(StringUtils.isNotBlank(deschotel)) {
|
||||
c.add(Restrictions.eq("hotel.deschotel", deschotel));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(desccolonia)) {
|
||||
c.add(Restrictions.eq("colonia.desccolonia", desccolonia));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(nombciudad)) {
|
||||
c.add(Restrictions.eq("ciudad.nombciudad", nombciudad));
|
||||
}
|
||||
|
||||
return c.list();
|
||||
}
|
||||
}
|
|
@ -6,9 +6,11 @@ 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.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
@ -47,7 +49,7 @@ public class Colonia implements Serializable {
|
|||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@ManyToOne
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "CIUDAD_ID")
|
||||
private Ciudad ciudad;
|
||||
|
||||
|
|
|
@ -0,0 +1,165 @@
|
|||
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.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@Table(name = "HOTEL")
|
||||
@SequenceGenerator(name = "HOTEL_SEQ", sequenceName = "HOTEL_SEQ", allocationSize = 1)
|
||||
public class Hotel implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "HOTEL_SEQ")
|
||||
@Column(name = "HOTEL_ID")
|
||||
private Long hotelId;
|
||||
|
||||
@Column(name = "DESCHOTEL")
|
||||
private String deschotel;
|
||||
|
||||
@Column(name = "CEP")
|
||||
private String cep;
|
||||
|
||||
@Column(name = "ENDERECO")
|
||||
private String endereco;
|
||||
|
||||
@Column(name = "NUMERO")
|
||||
private String numero;
|
||||
|
||||
@Column(name = "COMPLEMENTO")
|
||||
private String complemento;
|
||||
|
||||
@Column(name = "BAIRRO")
|
||||
private String bairro;
|
||||
|
||||
@Column(name = "CIDADE")
|
||||
private String cidade;
|
||||
|
||||
@Column(name = "ESTADO")
|
||||
private String estado;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.DATE)
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
public Long getHotelId() {
|
||||
return hotelId;
|
||||
}
|
||||
|
||||
public void setHotelId(Long hotelId) {
|
||||
this.hotelId = hotelId;
|
||||
}
|
||||
|
||||
public String getDeschotel() {
|
||||
return deschotel;
|
||||
}
|
||||
|
||||
public void setDeschotel(String deschotel) {
|
||||
this.deschotel = deschotel;
|
||||
}
|
||||
|
||||
public String getCep() {
|
||||
return cep;
|
||||
}
|
||||
|
||||
public void setCep(String cep) {
|
||||
this.cep = cep;
|
||||
}
|
||||
|
||||
public String getEndereco() {
|
||||
return endereco;
|
||||
}
|
||||
|
||||
public void setEndereco(String endereco) {
|
||||
this.endereco = endereco;
|
||||
}
|
||||
|
||||
public String getNumero() {
|
||||
return numero;
|
||||
}
|
||||
|
||||
public void setNumero(String numero) {
|
||||
this.numero = numero;
|
||||
}
|
||||
|
||||
public String getComplemento() {
|
||||
return complemento;
|
||||
}
|
||||
|
||||
public void setComplemento(String complemento) {
|
||||
this.complemento = complemento;
|
||||
}
|
||||
|
||||
public String getBairro() {
|
||||
return bairro;
|
||||
}
|
||||
|
||||
public void setBairro(String bairro) {
|
||||
this.bairro = bairro;
|
||||
}
|
||||
|
||||
public String getCidade() {
|
||||
return cidade;
|
||||
}
|
||||
|
||||
public void setCidade(String cidade) {
|
||||
this.cidade = cidade;
|
||||
}
|
||||
|
||||
public String getEstado() {
|
||||
return estado;
|
||||
}
|
||||
|
||||
public void setEstado(String estado) {
|
||||
this.estado = estado;
|
||||
}
|
||||
|
||||
public Boolean getActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(Boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
public Integer getUsuarioId() {
|
||||
return usuarioId;
|
||||
}
|
||||
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getDeschotel();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
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.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@Table(name = "PRECO_APANHE")
|
||||
@SequenceGenerator(name = "PRECO_APANHE_SEQ", sequenceName = "PRECO_APANHE_SEQ", allocationSize = 1)
|
||||
public class PrecoApanhe implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "PRECO_APANHE_SEQ")
|
||||
@Column(name = "PRECOAPANHE_ID")
|
||||
private Long precoapanheId;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "HOTEL_ID")
|
||||
private Hotel hotel;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "COLONIA_ID")
|
||||
private Colonia colonia;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "CIUDAD_ID")
|
||||
private Ciudad ciudad;
|
||||
|
||||
@Column(name = "PRECO", columnDefinition = "NUMBER(5,2)")
|
||||
private BigDecimal preco;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.DATE)
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
public Long getPrecoapanheId() {
|
||||
return precoapanheId;
|
||||
}
|
||||
|
||||
public void setPrecoapanheId(Long precoapanheId) {
|
||||
this.precoapanheId = precoapanheId;
|
||||
}
|
||||
|
||||
public Hotel getHotel() {
|
||||
return hotel;
|
||||
}
|
||||
|
||||
public void setHotel(Hotel hotel) {
|
||||
this.hotel = hotel;
|
||||
}
|
||||
|
||||
public Colonia getColonia() {
|
||||
return colonia;
|
||||
}
|
||||
|
||||
public void setColonia(Colonia colonia) {
|
||||
this.colonia = colonia;
|
||||
}
|
||||
|
||||
public Ciudad getCiudad() {
|
||||
return ciudad;
|
||||
}
|
||||
|
||||
public void setCiudad(Ciudad ciudad) {
|
||||
this.ciudad = ciudad;
|
||||
}
|
||||
|
||||
public BigDecimal getPreco() {
|
||||
return preco;
|
||||
}
|
||||
|
||||
public void setPreco(BigDecimal preco) {
|
||||
this.preco = preco;
|
||||
}
|
||||
|
||||
public Boolean getActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(Boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
public Integer getUsuarioId() {
|
||||
return usuarioId;
|
||||
}
|
||||
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
}
|
|
@ -6,6 +6,7 @@ package com.rjconsultores.ventaboletos.service;
|
|||
|
||||
import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
||||
import com.rjconsultores.ventaboletos.entidad.Colonia;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -16,5 +17,6 @@ public interface ColoniaService extends GenericService<Colonia, Integer> {
|
|||
|
||||
public List<Colonia> buscar(String desccolonia);
|
||||
public List<Colonia> buscarPorCiudad(Ciudad ciudad);
|
||||
public List<Colonia> buscaLike(String desccolonia);
|
||||
public List<Colonia> buscarPorCodMun(Ciudad ciudad, String desccolonia);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Hotel;
|
||||
|
||||
public interface HotelService extends GenericService<Hotel, Integer> {
|
||||
|
||||
public List<Hotel> buscar(String deschotel);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.PrecoApanhe;
|
||||
|
||||
public interface PrecoApanheService extends GenericService<PrecoApanhe, Integer> {
|
||||
|
||||
public List<PrecoApanhe> buscar(String deschotel, String desccolonia, String nombciudad);
|
||||
}
|
|
@ -9,9 +9,12 @@ import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
|||
import com.rjconsultores.ventaboletos.entidad.Colonia;
|
||||
import com.rjconsultores.ventaboletos.service.ColoniaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
@ -68,6 +71,11 @@ public class ColoniaServiceImpl implements ColoniaService {
|
|||
return coloniaDAO.buscarPorCiudad(ciudad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Colonia> buscaLike(String desccolonia) {
|
||||
return coloniaDAO.buscaLike(desccolonia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Colonia> buscarPorCodMun(Ciudad ciudad, String desccolonia) {
|
||||
return coloniaDAO.buscarPorCodMun(ciudad, desccolonia);
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.Calendar;
|
||||
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.HotelDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Hotel;
|
||||
import com.rjconsultores.ventaboletos.service.HotelService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("hotelService")
|
||||
public class HotelServiceImpl implements HotelService {
|
||||
|
||||
@Autowired
|
||||
private HotelDAO hotelDAO;
|
||||
|
||||
public List<Hotel> obtenerTodos() {
|
||||
return hotelDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public Hotel obtenerID(Integer id) {
|
||||
return hotelDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Hotel suscribir(Hotel entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return hotelDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Hotel actualizacion(Hotel entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return hotelDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void borrar(Hotel entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
hotelDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
public List<Hotel> buscar(String deschotel) {
|
||||
return hotelDAO.buscar(deschotel);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.Calendar;
|
||||
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.PrecoApanheDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.PrecoApanhe;
|
||||
import com.rjconsultores.ventaboletos.service.PrecoApanheService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("precoApanheService")
|
||||
public class PrecoApanheServiceImpl implements PrecoApanheService {
|
||||
|
||||
@Autowired
|
||||
private PrecoApanheDAO precoApanheDAO;
|
||||
|
||||
public List<PrecoApanhe> obtenerTodos() {
|
||||
return precoApanheDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public PrecoApanhe obtenerID(Integer id) {
|
||||
return precoApanheDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public PrecoApanhe suscribir(PrecoApanhe entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return precoApanheDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public PrecoApanhe actualizacion(PrecoApanhe entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return precoApanheDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void borrar(PrecoApanhe entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
precoApanheDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
public List<PrecoApanhe> buscar(String deschotel, String desccolonia, String nombciudad) {
|
||||
return precoApanheDAO.buscar(deschotel, desccolonia, nombciudad);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue