Trying to add API to room database. Not sure if I ...
# room
s
Trying to add API to room database. Not sure if I am creating the data classes correctly. Getting this error
public final class DatabaseBitcoin {
^
Tried the following constructors but they failed to match:
DatabaseBitcoin(int,com.example.paywithbitcoin.database.Time,java.lang.String,java.lang.String,java.util.List<com.example.paywithbitcoin.database.Currency>) -> [param:id -> matched field:id, param:time -> matched field:unmatched, param:disclaimer -> matched field:disclaimer, param:chartname -> matched field:chartname, param:bpi -> matched field:unmatched]/Users/drsilaswiggin/dev/kotlin/PayWithBitcoin/app/build/tmp/kapt3/stubs/debug/com/example/paywithbitcoin/database/DatabaseBitcoin.java:7: error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
g
To make it work you need default constructor, so at least you need default value for time and bpi, otherwise it cannot be created from database data