-->
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.  [ 10 posts ] 
Author Message
 Post subject: [Hibernate Search] Auto sync database changes with the index
PostPosted: Mon Dec 10, 2007 6:51 am 
Newbie

Joined: Mon Aug 27, 2007 5:47 am
Posts: 7
I m not able to autosync the database changes with the index in some situations. Following is the scenario.

Code:

@Indexed(index="case")
public class HdCaseMst {
    @DocumentId
    private long srNo;

    @IndexedEmbedded(prefix="person_")
    private CmnPersonMst cmnPersonMst;

    @Field(index=Index.TOKENIZED, store=Store.NO)
    private String cangenReason;

    .............
}

public class CmnPersonMst {
    ..........

    @Field(index=Index.TOKENIZED, store=Store.NO)
    private String firstName;

    ............

}



Here, CmnPersonMst is not indexed, but embedded in HdCaseMst. only it's field firstName is indexed.

Now, when the field "cangenReason" of HdCaseMst is updated, the corresponding index is also updated.

Also, using the following code, index is updated.

Code:
        caseMst.getCmnPersonMst().setFirstName("Miss kiran");
        session.update(caseAccMst);


but, when i try to update only CmnPersonMst individually as follows,

Code:
        personMst.setFirstName("viral test");
        session.update(personMst);


corresponding index is not updated.

is there any way to do the same? please note i don't want to make seperate index folder for CmnPersonMst.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 10, 2007 10:29 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
If CmnPersonMst is an entity, I am aware of the problem. I need to enhance the event catching (open a JIRA issue, I don't think it has been created yet).

If CmnPersonMst is an embeddable object, then I think you're wrong.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 10, 2007 10:40 am 
Newbie

Joined: Mon Aug 27, 2007 5:47 am
Posts: 7
Thanks for your help.

As i am new to hibernate, I haven't understand ur answer fully. I would really appreciate if you could explain it little more. specially regarding embeddable object. and diff between entity and embeddable object.

As per my knowledge, CmnPersonMst is an entity.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 12, 2007 10:37 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
An embeddable object is an boject whose lifecycle is fully dependent on the owner object. Typically, the embeddable object is not stored in a different table, it is stored in the same table as the owning entity. check the hibernate reference doc on 'component', or even better check the book Java Persistence with Hibernate (banner on top of this forum) for a deeper understanding.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 12, 2007 12:31 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-142


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 13, 2007 8:09 am 
Newbie

Joined: Mon Aug 27, 2007 5:47 am
Posts: 7
Thanks for opening an issue. :)


Top
 Profile  
 
 Post subject: Re: [Hibernate Search] Auto sync database changes with the index
PostPosted: Sun May 17, 2009 2:41 am 
Newbie

Joined: Sat May 09, 2009 6:14 am
Posts: 4
Thanks hardy for your link. I opened it and it helps me a lot. Great information. Fantastic.

Simulation pret immobilier


Top
 Profile  
 
 Post subject: Re: [Hibernate Search] Auto sync database changes with the index
PostPosted: Sun May 17, 2009 7:17 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
caramel1982 wrote:
Thanks hardy for your link. I opened it and it helps me a lot. Great information. Fantastic.

I'm happy it solved all your problems.
You will love this link as well:
https://www.hibernate.org/160.html

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


Top
 Profile  
 
 Post subject: Re: [Hibernate Search] Auto sync database changes with the index
PostPosted: Mon Jun 15, 2009 9:13 pm 
Newbie

Joined: Fri Jun 12, 2009 5:21 am
Posts: 2
Hi there, Would a new one like me be welcome here?
Thanks so much in deed.


pret personnel


Top
 Profile  
 
 Post subject: Re: [Hibernate Search] Auto sync database changes with the index
PostPosted: Fri Jun 19, 2009 8:56 pm 
Newbie

Joined: Fri Jun 19, 2009 8:54 pm
Posts: 1
It's really great. I like it very much.

pret auto


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