I have a domain layer and data layer. Is it possible to do this?
Domain: User.java UserDao.java
Data: UserRoomEntity.java UserRoomDao.java
I want all my data sources to implement the UserDao. When i make UserRoomDao implements UserDao interface i get errors that i should annotate the UserDao.java function with @insert and the rest of Room annotations. Is it possible to do this with Room?
@Dao
public abstract class UserRoomDao implments UserDao{
@Insert
public abstract void insert(User...users);
@Update
public abstract void update(User...users);
@Delete
public abstract void delete(User...users);
public interface UserDao {
public void insert(UserModel... userModels);
public void delete(UserModel... userModels);
public void update(UserModel... userModels);
}
i get this error in the UserDao.
error: An abstract DAO method must be annotated with one and only one of the following annotations: Insert, Delete, Query, Update, RawQuery