newbie question: best approach

Posts   
 
    
leon
User
Posts: 9
Joined: 23-Dec-2010
# Posted on: 17-May-2011 10:15:34   

Hi,

In the past I used joined queries to generate "readable", updatable lists for users. For instance:

not readable: custID,EmpId1,EmpID2,CountryID,Address 1,2,3,2,Hoofdstraat

readable: custName,EmpName,EmpName,Country,Address Jansen,Piet,Klaas,Nederland,Hoofdstraat

the "readable" variety using a query like: select c.custname,e1.empname,e2.empname.k.country, r.address from relation r inner join customer c on c.id = r.custid inner join employee e1 on e1.id = r.empid1 inner join employee e2 on e2.id = r.empid2 inner join country k on k.id = r.countryid

What's the best approach using LLBLGEN 1.Using prefetch and filling collections of CustomerEntities, EmployeeEntities,CountryEntities etc. So keep it all separated in their entities

2.Defining Views ( with joins ) in the database and let LLBLGEN create entities on those views ? So it's a kind of mixing of database entities using views

Leon

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 17-May-2011 10:55:42   

If the lsit would be Updatabale, then go for Fetching an EntityCollection of UserEntity, and prefetching related entities for the needed fields. (For better performance you can exclude all unwanted fields of the releated eneities from being fetched).

If the list is for Read-Only purposes then you can use TypedList (defined in the Designer), or a DynamicList (defined at code). Both are dataTables by the way.