• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Search without Annontation

 
Ganesh Bhambure
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we implement Hibernate Search without using annotation ?
or it is compulsory ?
 
Emmanuel Bernard
author
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Today the only metadata model supported is annotations. It is possible to write a XML descriptor and the underlying mechanics is available but nobody had the time or willingness to go and write this XML descriptor and parser.
If you are interested to contribute, have a look at http://www.hibernate.org/443.html

Now the question is more, what do you have against annotations?
 
Emmanuel Bernard
author
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW, you can still use hbm.xml mappings and use annotations for Hibernate Search metadata. chapter 2 of Hibernate Search in Action gives such an example
 
mort sahl
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>> Now the question is more, what do you have against annotations?

First of all ... I am a huge fan of annotations and use them whenever possible.

That said, annotations have a huge downside -- configuration via annotation requires rebuilding the code should something change. Properly written XML configuration should only require a restart of the application to take effect.
 
Ganesh Bhambure
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now the question is more, what do you have against annotations?


Actually I am not against annotations.
But Thought that Hibernate Search required hibernate annotation compulsory.

But As Emmanuel posted :
you can still use hbm.xml mappings and use annotations for Hibernate Search metadata.


It clears my query.

Thanks

- Ganesh
[ December 11, 2008: Message edited by: Ganesh Bhambure ]
 
Emmanuel Bernard
author
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That said, annotations have a huge downside -- configuration via annotation requires rebuilding the code should something change. Properly written XML configuration should only require a restart of the application to take effect.


I don't think this argument stands for Hibernate Search
When you change an indexing mapping (say a property or an entity), in 99% of the case you will change some code to build a better query or a different use case. So you will recompile.
 
Ganesh Bhambure
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you change an indexing mapping (say a property or an entity), in 99% of the case you will change some code to build a better query or a different use case. So you will recompile.


Yes, agree with Emmanuel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic