[
https://hibernate.onjira.com/browse/HSEARCH-1093?page=com.atlassian.jira....
]
Sanne Grinovero edited comment on HSEARCH-1093 at 4/13/12 10:28 AM:
--------------------------------------------------------------------
Marc, can you split this in two? It is a good idea to explore possible improvements
(I'll have to think a bit on your proposal), but I think opening an issue is higher
priority, we should for now at least consider the @Transient field suspicious enough to
flag it always dirty, much safer than consider it "not dirty" or we'd risks
to be not correct: -> bug.
And, unless you want to try solve it as well, you know I'm going to ask for a test
;-)
was (Author: sanne):
Marc, can you split this in two? It is a good idea to explore possible improvements
(I'll have to think a bit on your proposal), but I think opening an issue is higher
priority, we should for now at least consider the @Transient field suspicious enough to
flag it always dirty, much safer than consider it "not dirty" or we'd risks
to be not correct: -> bug.
And, unless you want to try solve it *as well*, you know I'm going to ask for a test
;-)
Smarter dirty checking with @Transient fields
---------------------------------------------
Key: HSEARCH-1093
URL:
https://hibernate.onjira.com/browse/HSEARCH-1093
Project: Hibernate Search
Issue Type: Improvement
Affects Versions: 4.1.0.Final
Reporter: Marc Schipperheyn
I found that if you have a field that is @Transient and depends on a Hibernate managed
field, this field is not updated when the underlying field changes.
{code}
@ManyToOne
@JoinColumn
@IndexedEmbedded
public Photo getPhoto() {
return photo;
}
@Transient
@Field
public String getMugshot(){
if(photo == null)
return null;
return getUserDirectory() + "/" + photo.getFilename();
}
{code}
This makes sense. However, it's not desirable. I would therefore want to propose an
annotation that can add some magic to dirty checking and inform Hibernate Search that when
@Field x gets dirty, the @Transient field should also be considered dirty
Something like
{code}
@ManyToOne
@JoinColumn
@IndexedEmbedded
public Photo getPhoto() {
return photo;
}
@Transient
@Field
@AssociateDirty(fields={"photo"})
public String getMugshot(){
if(photo == null)
return null;
return getUserDirectory() + "/" + photo.getFilename();
}
{code}
There are many names one might give to such an annotation. E.g. @YouDirtyMeDirty, but
many somehow sound a little "dirty" :-)
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira