Jak używać ORMLite z klasą abstrakcyjną?
Mam klasę bazowąPeripheral
. KlasySensor
iMaster
są rozszerzeniamiPeripheral
. Potrzebuję ORMlite do utworzenia instancji moich obiektów peryferyjnych, które zostały wcześniej zapisane. Oczywiście każda próba utworzenia instancjiPeripheral
refleksyjnie spowoduje aClassInstantiationException
ze względu na swoją abstrakcyjność. Jak mogę załadować ORMlite?Peripheral
obiekt odPeripheral
jest abstrakcyjny?
Oto przykład tego, co robię:
@DatabaseTable(tableName="Peripheral")
abstract class Peripheral {
@DatabaseField(generatedId="true")
int _ID;
@DatabaseField
int mSerial;
}
class Sensor extends Peripheral {
}
class Master extends Peripheral {
}