-->
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.  [ 1 post ] 
Author Message
 Post subject: entity inheritance query problem.
PostPosted: Sat Mar 09, 2013 6:29 am 
Newbie

Joined: Sat Mar 09, 2013 5:47 am
Posts: 1
hi;

I have 2 entities in my project.

Code:
@Entity
@Indexed
public class Content implements Serializable {

   private static final long serialVersionUID = 1L;

   @Id
   @GeneratedValue(strategy = GenerationType.AUTO)
   private Long id;
   
   @Lob
   @Field(name = "text", analyze = Analyze.YES, store = Store.YES)
   private String text;

   @ContainedIn
   @ManyToOne
   private Title title;

   public Long getId() {
      return id;
   }

   public void setId(Long id) {
      this.id = id;
   }

   public String getText() {
      return text;
   }

   public void setText(String text) {
      this.text = text;
   }

   public Mevzuat getTitle() {
      return title;
   }

   public void setTitle(Title title) {
      this.title = title;
   }

}


Code:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Indexed
public class Title implements Serializable {

   private static final long serialVersionUID = 1L;

   @Id
   @GeneratedValue(strategy = GenerationType.AUTO)
   private Long id;

   @OneToMany(mappedBy = "title")
   @IndexedEmbedded(depth = 1)
   private Set<Content> contentList;

   public Long getId() {
      return id;
   }

   public void setId(Long id) {
      this.id = id;
   }

   public Set<Content> getContentList() {
      return contentList;
   }

   public void setContentList(Set<Content> contentList) {
      this.contentList = contentList;
   }

}


I want to create query like this;

Code:
Query luceneQuery = parser.parse("contentList.text:hibernate and contentList.text:query");
Query query = fts.createQuery( luceneQuery, Title.class );


i want to try this for getting rows in contentList each rows have "hibernate" and "query" text. But search engine not querying for each rows, its querying whole list contains these words.

For querying embededindex for eachrows, what sould i do?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.