-1
Currently, I have a survey with Criteria that brings me results normally, but I want to add an implementation like NOT
.
Does anyone have any idea how I could do that?
I put in the code a comment with a possible idea of the implementation, but did not succeed.
Follow the code part:
@SuppressWarnings({ "unchecked" })
public List<ContaCorrenteModel> findByContaClieAssinat(Short banco, Short agencia, Long conta) {
List<ContaCorrenteModel> ccModel;
public List<ContaCorrenteModel> findByContaClieAssinat(Short banco, Short agencia, Long conta) {
List<ContaCorrenteModel> ccModel;
ArquivoLog.escreverLog
("Iniciando consulta [ClienteDaoImpl] findByContaClieAssinat - Parametros utilizados:"
+ " Banco " + banco +" Agencia " + agencia + " Conta " + conta );
this.session = ConexaoHibert.getInstance();
switch (Principal.getBase()) {
case CENTRAL:
List<TbCntaCrrtClie> tbCntaCrrtClieList = new ArrayList<TbCntaCrrtClie>();
Criteria crit = this.session.createCriteria(TbCntaCrrtClie.class, "conta");
crit.add(Restrictions.eq("conta.cdBanc", banco));
crit.add(Restrictions.eq("conta.cdAgen", agencia));
// Restricao que tenho que Adicionar a consulta criteria //
crit.add(Restrictions.not("conta.nrOrdeTitl", new Long(2) ));
crit.setFetchMode("nrSequPessUnic", FetchMode.JOIN);
crit.setFetchMode("tbPenumUnic.nrSequClieFirmPodr", FetchMode.JOIN);
crit.setFetchMode("tbPenumUnic.tbRpreGrupCollection", FetchMode.JOIN);
crit.setFetchMode("nrSequNatzCnta", FetchMode.JOIN);
tbCntaCrrtClieList = crit.list();
ArquivoLog.escreverLog("Total de clientes CENTRAL: " + tbCntaCrrtClieList.size());
ccModel = ContaCorrenteModelAdapter.adapt(tbCntaCrrtClieList);
break;