Nut icon indicating copy to clipboard operation
Nut copied to clipboard

Problem of Table Inheritance.

Open nasanjargal-b opened this issue 5 years ago • 1 comments

If the table is inherited and find by the field of the parent, it doesn't work.

class Person : public Nut::Table { Q_OBJECT NUT_PRIMARY_AUTO_INCREMENT(id) NUT_DECLARE_FIELD(int, id, getId, setId) }

class Student : public Person { Q_OBJECT NUT_DECLARE_FIELD(QString, name, getName, setName) }

db.student()->query()->where(Student::idField()==1)->first();

Error Message: Error executing sql command: no such column: Person.id

nasanjargal-b avatar Jan 21 '20 02:01 nasanjargal-b

ATM Nut is not detected table inheritance. But thanks for reporting, It's in my TODO list now. It will be fixed ASAP

HamedMasafi avatar Jan 21 '20 08:01 HamedMasafi