Answer the question
In order to leave comments, you need to log in
GreenDao join, now to select some columns?
Hello colleagues.
There is a raw request to the database:
select sn.[NEWSPAPER_MNEMONIK_NAME],
sh.[NUMBER_PUBLICATION],
sn.[PERIOD],
sb.[SUBSCRIBER_NAME],
sb.[PHONE1]
from SUBSCRIBER sb, [SHIPPING] sh, [SUBSCRIPTION] sn
where sn.[ID_SUBSCRIBER] = sb.[_id]
and sh.[ID_SUBSCRIPTION] = sn.[_id]
and sh.[STATUS_DELIVERY] = '0' -- (или '1' - доставлено)
QueryBuilder<Shipping> qb = shippingDao.queryBuilder()
.where(ShippingDao.Properties.Status_delivery.eq(0));
Join subscriptionJoin = qb.
join(ShippingDao.Properties.Id_subscription, Subscription.class);
Join subscriberJoin = qb.
join(subscriptionJoin,
SubscriptionDao.Properties.Id_subscriber,
Subscriber.class, SubscriberDao.Properties.Id);
List<Shipping> bigEuropeanCities = qb.list();
for(Shipping e :bigEuropeanCities) {
Log.d("LOG_TAG", e.getId_shipping().toString());
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question