This is a migrated thread and some comments may be shown as answers.

How do we use joins

3 Answers 119 Views
OQL (OQL specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paul
Top achievements
Rank 1
Paul asked on 20 May 2009, 12:35 PM
Hi,
    I have the following MySQL statement
  Select application.ApplicationID ,application.ApplicationName ,resourcelibrary.ResourceFile from application
  Left JOIN resourcelibrary on resourcelibrary.ResourceID=application.AppIconID ;

How can I achieve the same in OQL?

3 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 20 May 2009, 03:02 PM
Hi Paul,
Oql unlike SQL is OOP language. You dont need joins because you work with objects. In your class application there should be a field resourcelibrary from which you can access resource file. Here is an example:
Select x.ApplicationID,x.ApplicationName,x.ResourceFile from ApplicationExtent as x 
Note that the result will be represented as a an array of objects. You can iterate with it using code similar to this:
 foreach (object[] obj in result) 
            { 
                Console.WriteLine(obj[0] + " " + obj[1] + " "); 
            } 


Greetings,
PetarP
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Paul
Top achievements
Rank 1
answered on 20 May 2009, 03:09 PM
Hi,
    My application class does not have a  field resourcelibrary. How do I go about adding this using the reverse mapping wizard and linking the resourceID to the AppIconID.

Regards
Paul
0
PetarP
Telerik team
answered on 25 May 2009, 06:51 AM
Hi Paul,
when there is an relationship between two tables OpenAccess automatically picks this up and creates an object reference for you. If you have used the reverse mapping wizard and you haven't deleted this reference on purpose it should be there. Here is an article about the reverse mapping wizard that you might find useful.

Kind regards,
PetarP
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
OQL (OQL specific questions)
Asked by
Paul
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Paul
Top achievements
Rank 1
Share this question
or