j256 / ormlite-android

ORMLite Android functionality used in conjunction with ormlite-core
http://ormlite.com/
ISC License
1.59k stars 366 forks source link

Could not find public constructor with ConnectionSource and optional Class parameters class ... Missing static on class? #109

Closed harside closed 5 years ago

harside commented 5 years ago
java.sql.SQLException: Could not find public constructor with ConnectionSource and optional Class parameters class ...utils.dao.CustomDao.  Missing static on class?
 at com.j256.ormlite.dao.DaoManager.createDao(DaoManager.java:86)
 at com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper.getDao(OrmLiteSqliteOpenHelper.java:277)

This error appears when the apk is generated.

noordawod commented 5 years ago

Missing static on class? 😄

Please follow instructions: http://ormlite.com/docs/getting-started

harside commented 5 years ago

I was using a custom Dao class, this class is not necessary?

noordawod commented 5 years ago

You can use a custom Dao class, but you have to define a static property on it. Read the instructions mentioned above.

PrideFafy commented 2 years ago

I followed the instructions but I'm still getting an error. Maybe I'm missing the static property meaning. I did this on the entity class: @DatabaseTable( daoClass = AdministratorDaoImpl.class)