Home > Back-end >  Getting this error "Must have exactly 1 query in the value of @Query or @DatabaseView" in
Getting this error "Must have exactly 1 query in the value of @Query or @DatabaseView" in

Time:12-10

I need some help. I am getting this error "Must have exactly 1 query in the value of @Query or @DatabaseView" in my android studio project when I build my project. I am getting this error in my cartdao.java file code is here:

package com.example.xyz;

import androidx.room.Dao;

import androidx.room.Delete;

import androidx.room.Insert;

import androidx.room.Query;

import java.util.List;

@Dao public interface CartDao {

@Insert
void insertNew(CartOffline cartOffline);

@Query("")
List<CartOffline> getall();

@Query("")
List<CartOffline>  getCartProduct(String priceUnitId);

@Query("")
void updateObj(long quantity, String priceunitid);


@Query("")
void deleteObjbyPid(String priceunitid);

@Delete
void deleteObj(CartOffline cartOffline);

@Query("")
int getProductCount(String pId);

@Query("")
void deleteAll();
/*@Query("UPDATE CartOffline SET quantity = :quantity")
void updetCart()*/

}

CodePudding user response:

Try adding query

Ex your getAll function should return data from some table. Add queries to each of fun where you defined @Query annotation.

  • Related