gleimar 2012-09-08 15:37:53 +00:00
parent 17492e53f9
commit 413da62f78
6 changed files with 69 additions and 3 deletions

View File

@ -0,0 +1,8 @@
package com.rjconsultores.ventaboletos.dao;
import com.rjconsultores.ventaboletos.entidad.ParamConexion;
public interface ParamConexionDAO {
public ParamConexion actualizacion(ParamConexion paramConexion) ;
}

View File

@ -44,6 +44,12 @@ public class ConexionHibernateDAO extends GenericHibernateDAO<Conexion, Integer>
sb.append(" and pd1.paradaId = cc.destinoId ");
sb.append(" and po2.paradaId = c.origenId ");
sb.append(" and pd2.paradaId = c.destinoId ");
if (origenId != null){
sb.append(" and cc.origenId = ").append(origenId);
}
if (destinoId != null){
sb.append(" and cc.destinoId = ").append(destinoId);
}
sb.append(" ");
sb.append(" ");
sb.append("order by po1.descparada, pd1.descparada ,c.numgrupo, po2.descparada, pd2.descparada ");

View File

@ -0,0 +1,17 @@
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.ParamConexionDAO;
import com.rjconsultores.ventaboletos.entidad.ParamConexion;
@Repository("paramConexionDAO")
public class ParamConexionHibernateDAO extends GenericHibernateDAO<ParamConexion, Integer> implements ParamConexionDAO {
@Autowired
public ParamConexionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
setSessionFactory(factory);
}
}

View File

@ -40,7 +40,7 @@ public class ParamConexion implements Serializable {
@Temporal(TemporalType.TIMESTAMP)
private Date fecmodif;
@Column(name = "ACTIVO")
private Short activo;
private Boolean activo;
public ParamConexion() {
}
@ -97,11 +97,11 @@ public class ParamConexion implements Serializable {
this.fecmodif = fecmodif;
}
public Short getActivo() {
public Boolean getActivo() {
return activo;
}
public void setActivo(Short activo) {
public void setActivo(Boolean activo) {
this.activo = activo;
}

View File

@ -0,0 +1,9 @@
package com.rjconsultores.ventaboletos.service;
import com.rjconsultores.ventaboletos.entidad.ParamConexion;
public interface ParamConexionService {
public ParamConexion actualizacion(ParamConexion paramConexion);
}

View File

@ -0,0 +1,26 @@
package com.rjconsultores.ventaboletos.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.ParamConexionDAO;
import com.rjconsultores.ventaboletos.entidad.ParamConexion;
import com.rjconsultores.ventaboletos.service.ParamConexionService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@Service("paramConexionService")
public class ParamConexionServiceImpl implements ParamConexionService {
@Autowired
private ParamConexionDAO paramConexionDAO;
@Override
@Transactional
public ParamConexion actualizacion(ParamConexion paramConexion) {
paramConexion.setFecmodif(new java.util.Date());
paramConexion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
return paramConexionDAO.actualizacion(paramConexion);
}
}