Commit c6c27f3b authored by Muhammad Suryono's avatar Muhammad Suryono

maintenance daos

parent 6a44ae1a
package com.yono.messeripos.daos;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
......@@ -11,16 +12,17 @@ import com.yono.messeripos.models.ProductCartModels;
import java.util.List;
@Dao
public interface PaymentPendingDaos {
@Query("SELECT * FROM payment_pending ORDER BY id DESC")
@Query("SELECT * FROM paymentPending ORDER BY id DESC")
public LiveData<List<PaymentPending>> getAll();
@Query("SELECT * FROM payment_pending WHERE id_orders = :idOrders")
@Query("SELECT * FROM paymentPending WHERE id_orders = :idOrders")
public LiveData<List<PaymentPending>> getPaymentByIdOrder(String idOrders);
@Insert(onConflict = OnConflictStrategy.IGNORE)
public void insertPaymentPending(PaymentPending paymentPending);
@Query("UPDATE payment_pending SET id_nfc = :idNfc WHERE id = :id")
@Query("UPDATE paymentPending SET id_nfc = :idNfc WHERE id = :id")
public void updateNfc (String idNfc, long id);
}
......@@ -34,7 +34,7 @@ public abstract class LocalDatabase extends RoomDatabase {
synchronized (LocalDatabase.class){
if (INSTANCE == null){
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
LocalDatabase.class, "db_new").build();
LocalDatabase.class, "db_messer").build();
}
}
}
......
......@@ -8,7 +8,7 @@ import androidx.room.PrimaryKey;
import com.google.gson.annotations.SerializedName;
@Entity(tableName = "payment_pending")
@Entity(tableName = "paymentPending")
public class PaymentPending implements Parcelable {
@PrimaryKey(autoGenerate = true)
@SerializedName("id")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment