You could also use:

select name, id from customer_objtab o
where o.loyalty_card.id = 'loyaltyid';