-->
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.  [ 2 posts ] 
Author Message
 Post subject: [Hibernate Search] Mapping Components
PostPosted: Tue May 06, 2008 4:50 pm 
Newbie

Joined: Mon Apr 21, 2008 3:27 pm
Posts: 5
Hibernate Searcg version: 3.0.1.GA

Hi. I have two questions.
First, ¿how can i map a component in Hibernate Search?

I have this model:

Code:
@Indexed
public class A {

    @DocumentId
    private Long id;

    private B b;

}

public class B {

    private Collection<C> c;

}

public class C {

    private Long id;
    private String s;

}



Here i want to search A classes, and if i put "blah" that is in string "s", and an A class have this C class in his B component, i want to get this A class..

Is very easy, i think, but i dont know how to do this...

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 07, 2008 5:59 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

Have a look at how to index embedded entities: http://www.hibernate.org/hib_docs/search/reference/en/html_single/#d0e1322. The Place -> Adress-> Owner case is similar to your use case. You can just keet nesting embedded entities. The important thing to know is the field name under which the properties get stored into the index.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.