I have been trying to work through the HelloAndroid example for ORMLite but haven't been able to successfully compile. I am having a problem with the DatabaseHelper class. Specifically the getDao()
method:
/**
* Returns the Database Access Object (DAO) for our SimpleData class.
* It will create it or return the cached value.
*/
public Dao<SimpleData, Integer> getDao() throws SQLException {
if (simpleDao == null) {
simpleDao = getDao(SimpleData.class);
}
return simpleDao;
}
Here is the compile time error I am receiving:
Type parameters of D cannot be determined; no unique maximal instance exists for type variable D with upper bounds com.j256.ormlite.dao.Dao,com.j256.ormlite.dao.Dao
I got a similar error when trying to build my ormlite project using Netbeans:
Compiling 15 source files to ~/NetBeansProjects/Main/build/classes Main.java:74: type parameters of D cannot be determined; no unique maximal instance exists for type variable D with upper bounds com.j256.ormlite.dao.Dao,com.j256.ormlite.dao.Dao pcDao = DaoManager.createDao(connectionSource, PC.class);
Due to the comments I switched my Java Platform from OpenJDK 1.6 to Oracle's JDK 1.7.0_02 and it resolved the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With