Empty or Not Fetched

Posts   
 
    
Posts: 17
Joined: 12-Mar-2007
# Posted on: 12-Mar-2007 18:40:12   

This may already be covered somewhere, but I am unable to find it...

Is there any way to tell the difference between a child entity collection that is truly empty and one that was not fetched. It would help to have this information on the client. We're using the Adapter model.

ORMSupportClasses.NET20 version - 2.0.0.61205

Much thanks, David

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 12-Mar-2007 19:46:58   

I guess you mean the difference between a not-fetched entity collection and a fetched entityCollection with no entities found on the database (empty).

I think the same question was asked here: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=5918

Posts: 17
Joined: 12-Mar-2007
# Posted on: 12-Mar-2007 20:17:13   

@Walaa

Correct. I want to know on the client whether an entity's relations were fetched. Obviously, both a non-fetched and fetched by empty collection have the same count but mean two very different things.

The other post you referenced doesn't seem to really give a definitive answer. Is there no way to tell?

Regards, David

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 12-Mar-2007 21:35:13   

What I understand is:

at a certain point when you are going to perform an operation on an entityCollection, you should attempt to fetch it anyway. Coz if it was fetched before and the result showed no entities, there is a probability that if you fetch it again now, some entities might show up.

Posts: 17
Joined: 12-Mar-2007
# Posted on: 12-Mar-2007 21:46:17   

Walaa wrote:

What I understand is:

at a certain point when you are going to perform an operation on an entityCollection, you should attempt to fetch it anyway. Coz if it was fetched before and the result showed no entities, there is a probability that if you fetch it again now, some entities might show up.

Walaa,

That seems like an awful lot of (potentially) unnecessary fetching. We are talking in some cases about thick clients that will be asking a service for these entities.

Regards, David

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 13-Mar-2007 03:00:44   

I don't know of a way to tell if a Collection is just not fetched or empty. I think what the previous thread was saying is that if you are in the situation where the data may or may not have been fetched then it could be old data and you should fetch the data and not update existing entities if needed.

I know that's not exactly what you are looking for, would you mind posting your scenario so that we could see if there may be an alternative for you that would work well?