-->
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: index not update when object value change
PostPosted: Sat May 14, 2011 6:02 am 
Beginner
Beginner

Joined: Mon Dec 17, 2007 11:08 pm
Posts: 47
hi, i had issue of index not update when object change.

Code:
@Index
class A {

  @IndexEmbedded
  private Data data;
}

@indexed
class Data {

  @Field
  private int count; 

  public void update()
  {
      count++;     
  }

}


In class Data, that is no @ContainedIn to link back to Object A.

When i running a @transactional service which call data.update(), the value in database and lucene index Data is update (field name = count), but lucene index A.(field name = data.count) NOT updated.

i using hibernate 3.4.0 snapshot, lucene 3.1 and hibernate 3.6.4.

any idea ?

_________________
happy hacking !


Top
 Profile  
 
 Post subject: Re: index not update when object value change
PostPosted: Sun May 15, 2011 6:25 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
you need to use @ContainedIn, see the examples in the reference docs. This will also require to make this relation as a bi-directional relation.

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


Top
 Profile  
 
 Post subject: Re: index not update when object value change
PostPosted: Sun May 15, 2011 1:19 pm 
Beginner
Beginner

Joined: Mon Dec 17, 2007 11:08 pm
Posts: 47
ok cool, just test, it work now, thx :)

kiwi

_________________
happy hacking !


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.