There are two seperate, but related concepts that you need to get your head around.
The first of these is PreFetch paths. These allow you to fetch an entity (ie one row from a table) and along with it, all of its related entities from other tables.
To use the classic example, suppose you want to fetch a customer, along with each of his orders, and for each order, the collection of order lines.
Customer
|->Orders
|>OrderLines
This would look something like this.
IPrefetchPath prefetchPath = new PrefetchPath((int)EntityType.CustomerEntity);
prefetchPath.Add(CustomerEntity.PrefetchPathOrders).SubPath.Add(OrderEntity.PreFetchPathOrderLines);
CustomerEntity customer = new CustomerEntity("BLONP", prefetchPath);
The second concept is that of Relations. These allow you to effectivley specify SQL Joins. In the example above, if you wanted to fetch a flattened list consisting of 1 row for each order line, with related, and repeated, columns for the Order and Customer information, you could use a Dynamic List.
This would look something like
ResultsetFields fields = new ResultsetFields(3);
fields.DefineField(CustomerFields.FirstName, 0);
fields.DefineField(OrderFields.InvoiceNumber, 1);
fields.DefineField(OrderLineFields.ProductCode, 2);
IRelationCollection relations = new RelationCollection();
relations.Add(CustomerEntity.Relations.OrderEntityUsingCustomerId);
relations.Add(OrderEntity.Relations.OrderLineEntityUsingOrderId);
DataTable dynamicList = new DataTable();
TypedListDAO dao = new TypedListDAO();
dao.GetMultiAsDataTable(fields, dynamicList, 0, null, null, relations};
Hopefully this gives you a better understanding of what can be acheived with LLBLGen. Feel free to come back to us with any further questions.
Matt