gleimar 2013-02-18 18:54:37 +00:00
parent 6474559df2
commit f7c0bb1722
5 changed files with 51 additions and 42 deletions

View File

@ -11,6 +11,7 @@ import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Transformer;
import org.apache.commons.lang.StringUtils;
import org.hibernate.Criteria;
import org.hibernate.FetchMode;
import org.hibernate.Query;
@ -26,7 +27,6 @@ import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Marca;
import com.rjconsultores.ventaboletos.entidad.Usuario;
/**
*
* @author Administrador
@ -60,16 +60,12 @@ public class MarcaHibernateDAO extends GenericHibernateDAO<Marca, Short>
public List<Marca> buscarTodosExceto(Usuario usuario, Integer... idMarca) {
String hql = " select new com.rjconsultores.ventaboletos.entidad.Marca(marca.marcaId, marca.descmarca) from Marca marca, UsuarioEmpresa ue" +
" where marca.empresa = ue.empresa and ue.usuarioLog := usuarioId ";
" where marca.empresa = ue.empresa and ue.usuarioLog = :usuarioId ";
for(Integer marca: idMarca){
hql = hql + " and marca.marcaId <> "+ marca.shortValue();
}
hql = hql + " and marca.marcaId not in ( " + StringUtils.join(idMarca, ",") + ")";
Query sq = getSession().createQuery(hql);
sq.setParameter("usuarioId", usuario.getUsuarioId());
sq.setParameter("usuarioId", usuario);
List<Marca> lsMarca = sq.list();
return lsMarca;
@ -83,8 +79,6 @@ public class MarcaHibernateDAO extends GenericHibernateDAO<Marca, Short>
return lsMarca;
}
public List<Marca> buscarMarcaPorEmpresa(List<Empresa> empresa) {
if ((empresa == null) || (empresa.isEmpty())) {
return Collections.emptyList();

View File

@ -46,6 +46,7 @@ public class CategoriaCorrida implements Serializable {
private Integer usuarioId;
@JoinColumn(name = "CORRIDA_ID", referencedColumnName = "CORRIDA_ID")
@ManyToOne
@NotFound(action=NotFoundAction.IGNORE)
private CorridaCtrl corridaCtrl;
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
@ManyToOne

View File

@ -23,6 +23,9 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.SequenceGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
/**
*
* @author Administrador
@ -57,6 +60,7 @@ public class CategoriaCtrl implements Serializable {
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
private List<CategoriaMarca> categoriaMarcaList;
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
@NotFound(action=NotFoundAction.IGNORE)
private List<CategoriaCorrida> categoriaCorridaList;
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
private List<CategoriaMercado> categoriaMercadoList;

View File

@ -70,6 +70,10 @@ public class RutaServiceImpl implements RutaService {
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
if (entidad.getVentaOffLine() == null){
entidad.setVentaOffLine(false);
}
entidad = rutaDAO.suscribir(entidad);
if (lsParadasSequencia != null) {
generarSecuencias(entidad, lsParadasSequencia);

View File

@ -124,7 +124,13 @@ public class TramoRutaServiceImpl implements TramoRutaService {
ruta.setClaseServicio(rutaTramoVO.getClaseServicio());
ruta.setOrgaoConcedente(rutaTramoVO.getOrgaoConcedente());
ruta.setIndNombreObligatorio(rutaTramoVO.getSolicitaNombrePasajero());
if (rutaTramoVO.getVentaHandHeld() == null){
ruta.setVentaOffLine(false);
}else{
ruta.setVentaOffLine(rutaTramoVO.getVentaHandHeld());
}
ruta.setLsRutaEmpresa(lsRutaEmpresa);
ruta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
ruta.setActivo(Boolean.TRUE);