views:

107

answers:

1

Hi all,

I am using hibernate search 1.1. I want to apply ResultTransformer operation post query to match the targeted data structure.

But i cannot be able to find that class(StaticAliasToBeanResultTransformer) in the hibernate search jar. Where can i find this class?.

Thanks,

A: 

do you mean;

org.hibernate.transform.AliasToBeanResultTransformer? If so this is included in the main hibrenate jar included in the distro.

See javadocs

simon622
I am not using org.hibernate.transform package for this.Below code is used in my project.org.hibernate.search.FullTextQuery query = s.createFullTextQuery( luceneQuery, Book.class );query.setProjection( "title", "mainAuthor.name" );query.setResultTransformer( new StaticAliasToBeanResultTransformer( BookView.class, "title", "author" ) );List<BookView> results = (List<BookView>) query.list();for(BookView view : results) { log.info( "Book: " + view.getTitle() + ", " + view.getAuthor() );}Thanks,