-->
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.  [ 13 posts ] 
Author Message
 Post subject: Hibernate Search mappings without Annotations?
PostPosted: Sun Feb 10, 2008 7:35 pm 
Newbie

Joined: Tue Feb 05, 2008 2:43 am
Posts: 1
Hi,
I'm new to Hibernate Search. I'd like to add Hibernate Search capabilities to an existing application that uses Hibernate mappings already specified in .hbm.xml. As we have a couple of different configurations (with different mappings), I would prefer to keep using the XML approach rather than using Annotations so that the mappings can be easily switched.

Chapter 1 of the Hibernate Search user documentation says that Hibernate Search can be used without Annotations, however when I've searched the forums and online I have not turned up much information about doing this.

Is it possible to specify the mappings from entities to the index structure entirely in the XML files without using Annotations?
If it is, could someone please point me towards some documentation or examples?

Thanks,
Anna


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 4:43 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
What the documentation means is that you do not have to use Hibernate Annotations in order to specify your domain model. You can most definitely keep the domain configuration in xml files. However, Hibernate Search has its own set of annotations which are used to configure Lucene and entity to document mappings. There is no xml alternative for this. You will have to use annotations.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 19, 2008 7:51 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
hardy.ferentschik wrote:
There is no xml alternative for this. You will have to use annotations.


As I said before, this is probably round a week of work for someone to implement an XML model. The infrastructure is ready.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 21, 2008 4:39 am 
Pro
Pro

Joined: Wed Oct 03, 2007 2:31 pm
Posts: 205
Hi

Is there an update on whether there will be an alternative to hibernate search annotations? Personally I don't have a problem with the search annotations but I know there are people who get really funny about annotations...same way they were funny about xml configuration files! There is no pleasing some people....


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 21, 2008 12:18 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
A few people showed up to contribute, but vanished afterwards :)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 27, 2008 10:29 am 
Newbie

Joined: Fri Jan 16, 2004 9:59 am
Posts: 18
Location: La Plata-Argentina / Luxembourg
How can i contribute with the implementation of the xml configuration for hibernate search?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 08, 2008 12:15 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Sorry for the delay, I just put some instructions on the wiki area. Let me know what you think

http://www.hibernate.org/443.html

_________________
Emmanuel


Top
 Profile  
 
 Post subject: I had the same confusion about Search...
PostPosted: Tue Mar 11, 2008 7:43 am 
Newbie

Joined: Mon Mar 10, 2008 8:40 am
Posts: 6
I think the Hibernate Search Reference is causing this! No doubt!
I think a 48 pages document won't be hard to change!
And this topic is a very good matter to ask such change!

No reference document should leave ambiguities about how the thing is installed, configured, maintained, its dependencies and so on.

How can we purpose a change to the reference document?


Top
 Profile  
 
 Post subject: Re: I had the same confusion about Search...
PostPosted: Fri Mar 14, 2008 10:35 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
reFuser wrote:
I think the Hibernate Search Reference is causing this! No doubt!
I think a 48 pages document won't be hard to change!
And this topic is a very good matter to ask such change!

No reference document should leave ambiguities about how the thing is installed, configured, maintained, its dependencies and so on.

How can we purpose a change to the reference document?


The subject is about a new, currently non existing, feature: describing Hibernate Search metadata in XML rather than annotations. What are you talking about?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 14, 2008 11:56 am 
Newbie

Joined: Mon Mar 10, 2008 8:40 am
Posts: 6
The configurations/mappings for HibernateSearch can be done by two ways:
HIBERNATE ANNOTATIONS or
HIBERNATE COMMONS ANNOTATIONS.
And it can't be done by XML.

Despite the reference says "you can use it WITHOUT HIBERNATE ANNOTATIONS" it doesn't says what is the alternative way.

Curiously, the reference uses the alternative way (hibernate-commons-annotations) throughout the whole book!

In Hibernate Core, the alternative way for Hibernate Annotations is XML.
In Hibernate Search, the alternative way for Hibernate Annotations is another kind of Annotations!

Once I understood it, i got it running.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 14, 2008 11:57 am 
Newbie

Joined: Mon Mar 10, 2008 8:40 am
Posts: 6
The configurations/mappings for HibernateSearch can be done by two ways:
HIBERNATE ANNOTATIONS or
HIBERNATE COMMONS ANNOTATIONS.
And it can't be done by XML.

Despite the reference says "you can use it WITHOUT HIBERNATE ANNOTATIONS" it doesn't says what is the alternative way.

Curiously, the reference uses the alternative way (hibernate-commons-annotations) throughout the whole book!

In Hibernate Core, the alternative way for Hibernate Annotations is XML.
In Hibernate Search, the alternative way for Hibernate Annotations is another kind of Annotations!

Once I understood it, i got it running.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 14, 2008 1:40 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Ah you misunderstood it.
You can use either annotations or XML to map the ORM metadata for your entities. That's what the doc says.
But you need to use annotation to map the Search metadata for your entities.

Hibernate Annotations is a product http://annotations.hibernate.org.

Code:
<class name="Foo">
  <id name="id"/>
  <property name="name"/>
</class>

public class Foo {
  @DocumentId private Integer id;
  @Field private String name;
}

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 08, 2008 5:52 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
I created a new Jira issue http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-180 where I started to collect a few necessary documentation updates. Even though this thread was initially really about a completely new feature, I think we still could make the documentation a little less ambiguous.


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

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.