I try to update columns of "sale_delivery_detail" table using the following code.
RelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(SaleDeliveryDetailFields.FkSaleDeliveryId == saleDeliveryId);
bucket.PredicateExpression.Add(SaleDeliveryDetailFields.FkSaleDeliveryDetailStatusId == (long)SaleDeliveryDetailStatusEnumeration.Editing);
bucket.Relations.Add(SaleDeliveryDetailEntity.Relations.SaleOrderDetailEntityUsingFkSaleOrderDetailId);
SaleDeliveryDetailEntity entityWithNewValues = new SaleDeliveryDetailEntity();
bucket.PredicateExpression.Add(SaleOrderDetailFields.FkSaleOrderDetailTypeId == (long)SaleOrderDetailTypeEnumeration.Item);
entityWithNewValues.FkSaleDeliveryDetailStatusId = (long)SaleDeliveryDetailStatusEnumeration.ToBeProcessed;
UpdateDirectly(entityWithNewValues, bucket);
where UpdateDirectly just set the LastChange and LastChangeUser field and call Adapter.UpdateEntitiesDirectly.
The tables'structure is :
sale_delivery_detail
Id
FK_sale_delivery_detail_status_Id
FK_sale_order_detail_Id
LastChange
LastChangeUser
...
sale_order_detail
Id
FK_sale_order_detail_type_Id
LastChange
LastChangeUser
...
The generated query is this one :
UPDATE ( `sale_order_detail`
INNER JOIN `sale_delivery_detail` ON `sale_order_detail`.`Id`=`sale_delivery_detail`.`FK_sale_order_detail_Id`)
SET `FK_sale_delivery_detail_status_Id`=2, `LastChange`='20121217110410', `LastChangeUser`='DBEJOT\\sylvainb'
WHERE ( ( ( `sale_delivery_detail`.`FK_sale_delivery_Id` = 1 AND `sale_delivery_detail`.`FK_sale_delivery_detail_status_Id` = 1 AND `sale_order_detail`.`FK_sale_order_detail_type_Id` = 1)))
As you can see, the updated columns are not prefixed with the table name so the database throws the following exception "Column 'LastChange' in field list is ambiguous" because LastChange exists in both tables.
Is it a bug or is there something to do to force LLBLGEN to add prefix?