-->
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: Strange behavior of double field mark
PostPosted: Wed Sep 21, 2011 10:48 am 
Newbie

Joined: Tue Feb 08, 2011 10:05 am
Posts: 13
Hibernate Search allows to mark property and getter of field at once
Code:
@Field String title;
@Field String getTitle() { return title; }
This brings strange behavior of system and errors (for example with highlighter). I think HS should throw an exception at this situation


Top
 Profile  
 
 Post subject: Re: Strange behavior of double field mark
PostPosted: Thu Sep 22, 2011 4:23 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
It is up to you to place the annotations consistently. Generally it is recommended to consistently place them either on fields (for fields access) or on properties (for method access). The same applies for things like JPA or Bean Validation.
On the other hand, there are border cases where it might make sense (or you have to) to mix the annotation approach. Throwing an exception seems to be too strong.
You can open a Jira issue for Search and see what happens.

--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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.