-->
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.  [ 3 posts ] 
Author Message
 Post subject: some newbie questions about hibernate search
PostPosted: Mon Nov 17, 2008 8:00 pm 
Beginner
Beginner

Joined: Mon Oct 27, 2008 6:26 am
Posts: 36
Greeting, All, I need some help please.

In my hibernate application, I dont use annotation at all. This is my first time to use hibernate search.

Question 1: Is it possible use hibernate search without annotaion? Just like old way, set everything on xxx.hbm.xml

Question 2: For hibernate search, do I have to use JPA? Can I use it in my old hibernate application.

Question 3: The follows is my Student object mapping:

<class name="Student" table="course" batch-size="30" dynamic-insert="true" dynamic-update="true" >
<composite-id unsaved-value="none">
<key-property name="studentName" column="student_name" />
<key-property name="className" column="class_name" />
</composite-id>

As you seen, I do not create a composite key class.. In this case, how can I use @DocumentId to a composite ID?

Question 4: If a student has unidirectional relation with teacher, Can I still able to update index at same time.


Thanks
Ian


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 19, 2008 12:14 pm 
Beginner
Beginner

Joined: Mon Oct 27, 2008 6:26 am
Posts: 36
anybody?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2008 3:34 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
Quote:
Question 1: Is it possible use hibernate search without annotaion? Just like old way, set everything on xxx.hbm.xml

you can't set the Search annotations in hbm.xml, but you can use entities mapped in hbm.xml and add only the annotations needed for Search.

Quote:
Question 2: For hibernate search, do I have to use JPA? Can I use it in my old hibernate application.

Works both with JPA and Hibernate; JPA wraps the Hibernate implementation, so there are no implementation differences.

Quote:
Question 3: The follows is my Student object mapping:

not sure about this one, I think you need the composite key class.

Quote:
Question 4: If a student has unidirectional relation with teacher, Can I still able to update index at same time.

it depends on the direction of the relation; it's possible you need to change it to a bidirectional. check the reference docs, section 4.1.3
http://www.hibernate.org/hib_docs/search/reference/en/html/search-mapping.html#d0e1322

_________________
Sanne
http://in.relation.to/


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