TypedView predicate on different table

Posts   
 
    
tomahawk
User
Posts: 169
Joined: 02-Mar-2005
# Posted on: 31-Mar-2011 01:11:40   

LLBLGen 2.6 Final SQL Server 2008 Adapter .NET 3.5

I have a TypedView, and I need a FullText predicate against a field in a another table joined against the TypedView.

How can I accomplish this? I need to accomplish something like the following:

"SELECT t1.* FROM TypedView t1 JOIN OtherTableWithFullText t2 ON t1.id=t2.id WHERE CONTAINS([Predicate])"

I don't see an option to use a TypedList, as Views aren't shown as a source.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 31-Mar-2011 05:17:48   

Mmm :\ You don't have access to the fields is they are not present in the view. A workaround could be create another view where you join to that second table. Is that feasible for you?

David Elizondo | LLBLGen Support Team
tomahawk
User
Posts: 169
Joined: 02-Mar-2005
# Posted on: 31-Mar-2011 06:15:06   

From I've seen, SQL Server doesn't allow you to use Full Text predicates against the columns in Views unless you've indexed the view itself.

Can't I somehow use a Relation to get a JOIN to happen between the TypedView and my predicate table for the purposes of filtering?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 31-Mar-2011 10:27:54   

You can "Join" in code between a TypedView and an Entity.

e.g:

var spainOrders = new OrdersQryTypedView();
var filter = new RelationPredicateBucket(CustomerFields.Country == "Spain");
filter.Relations.Add(new EntityRelation(OrdersQryFields.CustomerId, CustomerFields.CustomerId, RelationType.ManyToOne));

adapter.FetchTypedView(spainOrders, filter, false); ;