fixes bug#AL-3498
parent
cc5b412f2d
commit
be39c021c8
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ModelWeb</artifactId>
|
||||
<version>1.22.0</version>
|
||||
<version>1.22.1</version>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Corrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.CorridaInfo;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorridaInfo;
|
||||
|
||||
public interface CorridaInfoDAO extends GenericDAO<CorridaInfo, Integer> {
|
||||
|
||||
void borrarByCorrida(Corrida corrida);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import org.hibernate.SQLQuery;
|
||||
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.CorridaInfoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Corrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.CorridaInfo;
|
||||
|
||||
@Repository("corridaInfoDAO")
|
||||
|
@ -15,5 +17,18 @@ public class CorridaInfoHibernateDAO extends GenericHibernateDAO<CorridaInfo, In
|
|||
public CorridaInfoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void borrarByCorrida(Corrida corrida) {
|
||||
|
||||
StringBuilder sQuery = new StringBuilder("DELETE FROM Corrida_Info WHERE corrida_Id = :corridaId AND TRUNC(feccorrida) = :feccorrida ");
|
||||
SQLQuery qrUpdate = getSession().createSQLQuery(sQuery.toString());
|
||||
|
||||
qrUpdate.setParameter("feccorrida", corrida.getId().getFeccorrida());
|
||||
qrUpdate.setParameter("corridaId", corrida.getId().getCorridaId());
|
||||
qrUpdate.executeUpdate();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Corrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.CorridaInfo;
|
||||
|
||||
public interface CorridaInfoService extends GenericService<CorridaInfo, Integer> {
|
||||
|
||||
void borrarByCorrida(Corrida corrida);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CorridaInfoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Corrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.CorridaInfo;
|
||||
import com.rjconsultores.ventaboletos.service.CorridaInfoService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
@ -59,4 +60,11 @@ public class CorridaInfoServiceImpl implements CorridaInfoService {
|
|||
corridaInfoDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
||||
@Override
|
||||
public void borrarByCorrida(Corrida corrida) {
|
||||
corridaInfoDAO.borrarByCorrida(corrida);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue