@FilterDef + @Filter + session.enableFilter AJUDA

Boa noite!
Estou tentando utilizar as anotações @FilterDef + @Filter nas classe abaixo:
alguem sabe USAR esses filter???
ja tentei de tudo que foi jeito…
mais na hora que eu passo a LIST para o relatorio ele não respeita o @FILTER: @Filter(name = “filtraData”, condition = “dataAgenda between :from and :to”)

ou seja se eu passar por exemplo de datas do dia 10/07/2012 até 10/07/2012
ele retornar TODOS AS DATAS ou seja o filtro não se aplica.

Alguma ideia??

Classe AGENDA.

@Entity
@FilterDef(name = "filtraData", parameters = {
    @ParamDef(name = "from", type = "java.util.Date"),
    @ParamDef(name = "to", type = "java.util.Date")
})
//@Filters({
//    @Filter(name = "filtraData", condition = "dataAgenda between :from and :to")
////@Filter (name = "filtraData", condition = "dataAgenda between '2012-07-08' and '2012-07-08'")
//})
public class Agenda implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @OneToOne(targetEntity = Advogado.class, optional = false)
    @Cascade(CascadeType.ALL)
    private Advogado advogado;
    @Fetch(FetchMode.JOIN)
    @Cascade(CascadeType.ALL)
    //@JoinColumn(name = "agenda_id", referencedColumnName = "id")
    @OneToMany(fetch = FetchType.LAZY, mappedBy="agenda")
    //@Filter(name = "filtraData", condition = "dataAgenda between :from and :to")
    //@Filter(name="filtraData", condition = "dataAgenda between '2012-07-08' and '2012-07-08'")
    //    @JoinTable(name = "agendaData",
    //joinColumns = {
    //   @JoinColumn(name = "agenda_id",referencedColumnName="id")}
    /*
     * ,inverseJoinColumns = { @JoinColumn(name =
     * "id",referencedColumnName="agenda_id")})
     */
    //@Filter(name = "filtraData", condition = "dataAgenda between :from and :to")
//    @JoinTable(name = "agendaData",
//    joinColumns = {
//        @JoinColumn(name = "agenda_id", referencedColumnName = "id")})
    //@FilterJoinTable(name = "filtraData", condition = "dataAgenda between :from and :to")
    @Filter(name = "filtraData", condition = "dataAgenda between :from and :to")
    private List<AgendaData> agendaDatas = new ArrayList<>();

    public Agenda() {
    }

.................

Classe AgendaData

@Entity
@Table(uniqueConstraints = {
    @UniqueConstraint(name = "uk_agenda_data", columnNames = {"agenda_id", "dataAgenda"})})
//@FilterDef(name = "filtraData", = "dataAgenda between :from and :to")
//    @ParamDef(name = "from", type = "java.util.Date"),
//    @ParamDef(name = "to", type = "java.util.Date")
//})
@Filters({
    @Filter(name = "filtraData", condition = "dataAgenda between :from and :to")})
//@Filter(name = "filtraData", condition = "dataAgenda between :from and :to")
public class AgendaData implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    //@JoinColumn(name = "agenda_id")
    //@Fetch(FetchMode.JOIN)
    private Agenda agenda;    
    @Temporal(TemporalType.DATE)
    private Date dataAgenda;
    //@Fetch(FetchMode.JOIN)
    @Cascade(org.hibernate.annotations.CascadeType.ALL)
    @OneToMany(mappedBy = "agendaData", targetEntity = AgendaDataEvento.class, fetch = FetchType.LAZY)
    private List<AgendaDataEvento> agendaDataEventos = new ArrayList<>();

Parte do Código do CONTROLE que irá filtrar:

[code] @Override
public List consultaAgendaPorAdvogadoPeriodo(Advogado advogado, Date dataIni, Date dataFim) {
List lista = null;
try {
//HibernateUtility.getSession().beginTransaction();
Session session = HibernateUtility.getSession();
//session.beginTransaction();
Filter filter = session.enableFilter(“filtraData”);
filter.setParameter(“from”, dataIni);
filter.setParameter(“to”, dataFim);
lista = session.createCriteria(Agenda.class).list();
//lista = session.createQuery(“from Agenda where id = 2”).list();

        //lista = session.createQuery("from Agenda where advogado_id = :advogado_id").setLong("advogado_id", advogado.getId()).list();            
        session.disableFilter("filtraData");
        //session.getTransaction().commit();
        //HibernateUtility.getSession().close();
    } catch (Exception e) {
    }
    return lista;
}[/code]

Saída Netbeans

18:45:20,191 DEBUG SQL:104 - 
    /* criteria query */ select
        this_.id as id20_7_,
        this_.advogado_id as advogado2_20_7_,
        advogado2_.id as id18_0_,
        pessoa3_.id as id8_1_,
        pessoa3_.advogado as advogado8_1_,
        pessoa3_.cliente as cliente8_1_,
        pessoa3_.dataCadastro as dataCada4_8_1_,
        pessoa3_.documentoEstadual as document5_8_1_,
        pessoa3_.documentoFederal as document6_8_1_,
        pessoa3_.fornecedor as fornecedor8_1_,
        pessoa3_.funcionario as funciona8_8_1_,
        pessoa3_.nome as nome8_1_,
        pessoa3_.observacoes as observa10_8_1_,
        pessoa3_.situacaoCadastro as situaca11_8_1_,
        pessoa3_.tipoPessoa as tipoPessoa8_1_,
        pessoa3_.versao as versao8_1_,
        cliente4_.id as id1_2_,
        fornecedor5_.id as id17_3_,
        funcionari6_.id as id6_4_,
        funcionari6_.dataAdmissao as dataAdmi2_6_4_,
        funcionari6_.dataDemissao as dataDemi3_6_4_,
        funcionari6_.funcao_id as funcao6_6_4_,
        funcionari6_.numCarteiraTrabalho as numCarte4_6_4_,
        funcionari6_.versao as versao6_4_,
        informacoe7_.id as id19_5_,
        informacoe7_.dataEmissaoRG as dataEmis2_19_5_,
        informacoe7_.dataNascimento as dataNasc3_19_5_,
        informacoe7_.estadoCivil as estadoCi4_19_5_,
        informacoe7_.nomeMae as nomeMae19_5_,
        informacoe7_.nomePai as nomePai19_5_,
        informacoe7_.orgaoExpedidorRG as orgaoExp7_19_5_,
        informacoe7_.profissao as profissao19_5_,
        informacoe7_.sexo as sexo19_5_,
        agendadata8_.agenda_id as agenda3_20_9_,
        agendadata8_.id as id9_,
        agendadata8_.id as id21_6_,
        agendadata8_.agenda_id as agenda3_21_6_,
        agendadata8_.dataAgenda as dataAgenda21_6_ 
    from
        Agenda this_ 
    inner join
        Advogado advogado2_ 
            on this_.advogado_id=advogado2_.id 
    left outer join
        Pessoa pessoa3_ 
            on advogado2_.id=pessoa3_.id 
    left outer join
        Cliente cliente4_ 
            on pessoa3_.id=cliente4_.id 
    left outer join
        Fornecedor fornecedor5_ 
            on pessoa3_.id=fornecedor5_.id 
    left outer join
        Funcionario funcionari6_ 
            on pessoa3_.id=funcionari6_.id 
    left outer join
        InformacoesPessoais informacoe7_ 
            on pessoa3_.id=informacoe7_.id 
    left outer join
        AgendaData agendadata8_ 
            on this_.id=agendadata8_.agenda_id 
            and agendadata8_.dataAgenda between ? and ?

brother…

conseguiu resolver seu problema? estou com o mesmo problema , apanhando 2 dias pra tentar desvendar o problema.