use of ch.hsr.sa.radiotour.dataaccess.models.Maillot in project app by TourLive.
the class MaillotRepository method addRiderToMaillot.
@Override
public void addRiderToMaillot(Maillot maillot, int riderDbId) {
Realm realm = Realm.getInstance(RadioTourApplication.getInstance());
Maillot realmMaillot = realm.where(Maillot.class).equalTo("id", maillot.getId()).findFirst();
Rider rider = realm.where(Rider.class).equalTo("riderID", riderDbId).findFirst();
realm.beginTransaction();
realmMaillot.setRider(rider);
realm.commitTransaction();
}
Aggregations