incorrect listing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abhishekraj
    New Member
    • Jul 2010
    • 1

    incorrect listing

    want to list all availble books in library by publisher. it is listing not availables also.

    Code:
    public List<Book> findByPublisher(String publisher) {
    	Book b = new Book();
    	Status status = new Status();
    	status.setId(Book.STATUS_AVAILABLE);
    	b.setStatus(status);//this filter is not working
    	b.setPublisher(publisher);
    		
    return (List<Book>) this.hibernateTemplate.findByExample(b);
    	}
    Last edited by Dormilich; Aug 2 '10, 06:13 AM. Reason: spelling, changed title, [code] tags
  • Bret Little
    New Member
    • Aug 2010
    • 3

    #2
    Hi there,

    In order for a sufficient response to your question, I think that you need to provide more of an explanation of what is going on (ie. more code). For example, why do you think the setStatus method is not working? What is it doing? Also, what does the findByExample() method do? It would seem to me if the setStatus method is working properly, then your problem would be somewhere in findByExamle()

    Comment

    Working...