Login Skip Navigation LinksWilsonORMapper > Forums Search
Demo Version Demo Version
Download and try for yourself a fully working demo version, including sample apps and documentation.  The only limitation is that the demo version only works inside the debugger.

PayPal Subscribe
Get It All for $50 USD:
WebPortal, ORMapper,
Source Code, All Updates
PayPal

User Login User Login
Log In
 
 
Reset Password

Wilson ORMapper Forums Wilson ORMapper Forums : OPath Queries : A simple OPath question

Date Post
9/27/2006 11:12:55 AM

Hi everyone,

I have used Paul's ORM for a few days now and really enjoying it. Things are beginning to work quite nicely! Today was the first time I wanted to use an OPathQuery.

Here's what my SQL query looks like:

select p.petname
from dog p
inner join dog s on p.sire = s.id
where s.petname = 'turi'

The Dog object was mapped by Paul Welter's template to have a SireDogObject

Here's my OPath query and the code:

OPathQuery<Dog> query = new OPathQuery<Dog>("SireDogObject.PetName == ?");
Collection<Dog> pups = DataManager.ObjectSpace.GetCollection<Dog(query,"Turi");

Well, the SQL query returns two rows but the pups collection contains 0 objects! It feels like I have a fundamentally wrong understanding of how OPath works. Can someone please help put me on the right track?

Many thanks,
Dany.

10/2/2006 6:39:06 AM

Hi Dany,

Are you still having trouble?  If so, is the problem with the OPath query not returning the correct results or the objects returned from the query not having the correct data in the collections?  If it's the latter as I suspect, than there is likely something up with the mapping file/entity class.

Thanks,
Jeff Lanning

10/3/2006 2:08:16 AM Hi Jeff,

Yup, I'm still having problems. It's more like the former of the two you mentioned. The collection "pups" always has zero count.

I'm using SharpDevelop and fairly new at it so not sure how all the features work. Not sure if I can debug and see what the SQL query from that OPath looks like, nor can I "profile" the DB calls like MSSQL.

Thanks,
D.
10/3/2006 2:10:15 AM Sorry, forgot to mention, the mapping and classes were generated with Paul Welter's latest template. I have never ventured to manual mapping generation yet...