I am currently combining Mike Penz Fastadapter with Android Room. The expandable model class needs to be implemented like this:
public class MyClass<Parent extends IItem & IExpandable,
SubItem extends IItem & ISubItem>
extends AbstractExpandableItem<MyClass<Parent, SubItem>, MyClass.ViewHolder, SubItem> {
I want to use the model also as a room entity. The first problem was easy to solve - I created a custom version of AbstractExpandableItem where the fields would be annoteted with @Ignore tags to not brake the code generation. A simpler implementation of Fastadapter worked just fine this way.
However, Room seems to have a problem with bounded type parameters for entities, as it throws these compile errors in the DAO implementation:
- Error:(40, 115) error: cannot find symbol class Parent
- Error:(40, 123) error: cannot find symbol class SubItem
My DAO is:
@Dao
public interface MyDAO {
@Query("Select * from Table")
LiveData<List<MyClass>> getAllStuff();
Unlike this guy, I could not solve my issues with an update - I put my Room gradle version on 1.1.1 and the error still happens.