-->
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: How do I index values from Parent classes?
PostPosted: Thu Mar 26, 2009 10:20 am 
Newbie

Joined: Wed Mar 25, 2009 9:10 pm
Posts: 1
How do I index values from Parent classes. I've been looking around in the documentation and haven't seen an example. This seems simple enough, what am I missing?

Say i have a class for instance

public class deposit {
public int deposit;


public int getDeposit(){
return deposit;
}

}


and a class that inherits it

public class savingsDepositAccount extends deposit{

public int checkBalance(){

}

}


I want to index all the savingsDespositAccount classes and index the deposit value from the parent class. How should I go about doing this?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 26, 2009 3:49 pm 
Hibernate Team
Hibernate Team

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

Add @Indexed to SavingsDepositAccount since this is the class you want to index, Then add @Field annotations to all fields you want to have indexed. This includes properties in base classes. Just add @Field to getDeposit().

--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.