Here is a sample POJO
public class Product{
private long id;
private String name;
private double price;
... constructor for all fields
... getters a
Primitive types are by default not null. Make the price Double and this will solve the issue since it will be nullable then. Furthermore, you can add a custom getter to avoid having price as a null object.
public double getPrice(){
if(this.price == null) return 0.0;
return this.price;
}
@Ingore tells Room to ignore the field altogether, which is not what you want, based on your answer.