Right Join

Posts   
 
    
nefise
User
Posts: 22
Joined: 01-Dec-2006
# Posted on: 29-Dec-2006 16:27:27   

llblgen Pro version 2.0 , Adapters, Oracle, .NET 2005

I am trying to simulate the following query in llblgen

select a.* , b.* from personel a, personel_nufus_bilgi b where a.sicil_no = b.sicil_no(+)

I create a typed list as PersonelNufusRel and the main table is Personel and the related table is TablePersonelNufusBilgi. There are 335 records in the first table and 1 record in the second table and i want to retrieve all of the data in the first table with the related ones in the second table.

And I tried the following;

ConfidaDB.TypedListClasses.PersonelNufusRelTypedList PersonelNufus = new ConfidaDB.TypedListClasses.PersonelNufusRelTypedList();

        IRelationPredicateBucket bucket = PersonelNufus.GetRelationInfo();

        bucket.Relations.Add(PersonelEntity.Relations.PersonelNufusBilgiEntityUsingSicilNo, JoinHint.Right);
        bucket.Relations.ObeyWeakRelations = true;

        ISortExpression sorter = new SortExpression(PersonelFields.SicilNo | SortOperator.Ascending);

       _adapter.FetchTypedList(PersonelNufus.GetFieldsInfo(), PersonelNufus, bucket, 0, sorter, false);

But it only retrieves one record what is the problem?

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 30-Dec-2006 03:11:35   

Can you try reversing the order that you added the entities in the typed list? Also can you post the query that is bing generated? Add this to your config file, you can find more on this in troubleshooting.


<system.diagnostics>
    <switches>
        <add name="OracleDQE" value="4" />
    </switches>
</system.diagnostics>
Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 30-Dec-2006 13:11:43   

nefise wrote:

llblgen Pro version 2.0 , IRelationPredicateBucket bucket = PersonelNufus.GetRelationInfo();

        bucket.Relations.Add(PersonelEntity.Relations.PersonelNufusBilgiEntityUsingSicilNo, JoinHint.Right);
        bucket.Relations.ObeyWeakRelations = true;

        ISortExpression sorter = new SortExpression(PersonelFields.SicilNo | SortOperator.Ascending);

       _adapter.FetchTypedList(PersonelNufus.GetFieldsInfo(), PersonelNufus, bucket, 0, sorter, false);

Hi you do not need to add the releation to the table, because it is already added by the GetRelationInfo method. You need to open the typedlist with the LLBLGen designer and edit the relation between both tables and change the hint to Left join.