-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: @Filter don`t work on jboss
PostPosted: Mon Sep 01, 2008 3:48 am 
Newbie

Joined: Mon May 29, 2006 7:37 am
Posts: 4
Hi everybody,
I have a simple test application with @Filter feature. The problem is the filter don`t work (resulting SQL do not include filter condition).

The entity:
Code:
@Entity
@Table(name = "test_a_table")
@FilterDef(name = "valueTest")
@Filter(name = "valueTest", condition = "(value = 'test')")
public class A {
    @Id
    @Column
    private String id;

    @Column
    private String value;

    ...
}


DAO:
Code:
@Stateless
public class ADaoImpl implements ADao {
    @PersistenceUnit
    private EntityManagerFactory emf;

    public Session getSession() {
        return (Session) emf.createEntityManager().getDelegate();
    }

    public List<A> getAll() {
        getSession().enableFilter("valueTest");
        return getSession()
                .createCriteria(A.class)
                .list();
    }

    ....
}


Result Code:
Code:
    /* criteria query */ select
        this_.id as id72_0_,
        this_.value as value72_0_
    from
        test_a_table this_


Here is maven project zipped: http://6709.su/test.zip (8KB)

PS: Jboss 4.2.2.GA (hibernate 3.2.4.sp1)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.