QuoteReplyTopic: How to get EntityCollection with out having Relations Posted: 13-Aug-2008 at 9:22am
Viral,
I'm still not sure I understand why you say that fetching data from Correlation causes an automatic fetch from Partner due to their relationship. Fetching related data is a function of the query, so it may be something you can turn off it you think DevForce is doing it unnecessarily. Can you post your LINQ / EntityQuery too?
Scenario is that we are going to fetch data from “Correlation” Entity, which has the schema as given. When we are going to fetch data from correlation, it will get data from Partner Entity also as it has a relation with partner.
=========Entity Schema of Correlation =================
Schema of partner is given below. If partner has any relation with any another entity, then it will get data of that entity. That will give us the time out errors in most of the cases.
======== Entity Schema of Partner======================
Without knowing both your Entity definition and the underlying table schema, and the actual resolved eSQL query, I really can't help diagnose why you're getting these errors. If you'd like help with this you can send a small reproducible case to support.
As for querying an entity without pulling in relations, that's easy to do. Related entities are not fetched except when a) one or more Include statements are part of the query, or b) the query references related entities and must be 'inverted" in order to load cache with all required data. A simple query such as:
var query = entityManager.Customers.Where(c=> c.Id ==1)
will retrieve only the single requested customer and not any related entities.
If you're seeing an EntityQuery which you think is erroneously retrieving related entities too, please post it here.
passthruEsqlQuery = new PassthruEsqlQuery(typeObject, new ParameterizedEsql("SELECT VALUE resultsql from " + EnglishGrammarRules.Pluralize(typeObject.Name) + " AS resultsql WHERE " + objFieldName));
else
passthruEsqlQuery =
new PassthruEsqlQuery(typeObject, new ParameterizedEsql("SELECT VALUE resultsql from " + EnglishGrammarRules.Pluralize(typeObject.Name) + " AS resultsql WHERE resultsql." + objectName + "." + objectName + "Id LIKE '%" + Id + "%'"));
"Cannot evaluate expression because a native frame is on top of the call stack".
because of the above errors, I would like to know is there any alternate way to get the data for particular entity without getting its Relations. If possible than please let us know as soon as possible.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum