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: IndexedEmbedded and ISet.
PostPosted: Mon Aug 11, 2008 8:30 am 
Newbie

Joined: Mon Jul 14, 2008 5:17 am
Posts: 3
Hi.

I'm using NHibernate.Search 2.0.0.1001. I have 2 classes that have ManyToMany relationship. How can i search one class over another?

for example, I have

first class
[Indexed]
public class Owner
{
[DocumentId]
public int Id { get; set; }
[Field(Index.Tokenized, Store = Store.Yes)]
public String Name { get; set; }
public ISet<Car> Cars { get; set; }
}

second class
[Indexed]
public class Car
{
[DocumentId]
public int Id { get; set; }
[Field(Index.Tokenized, Store = Store.Yes)]
public String Name { get; set; }
public ISet<Owner> Owners { get; set; }
}
}

fill db
Car car = new Car() { Name = "BMW" };
car.Create();
Car car2 = new Car() { Name = "Lexus" };
car2.Create();
Owner owner = new Owner() { Name = "Alex" };
owner.Cars.Add(car);
owner.Create();
Owner owner2 = new Owner() { Name = "David" };
owner2.Cars.Add(car);
owner2.Cars.Add(car2);
owner2.Create();

I want to find all Owners that have a "BMW"


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.