Page 1 of 1
Multi column primary index

Posted:
Mon Jan 03, 2011 10:19 am
by ruddy32
Hi,
How to declare primary index based on 2 columns using QX_REGISTER_PRIMARY_KEY macro ?
Thanks
Re: Multi column primary index

Posted:
Tue Jan 04, 2011 11:21 am
by QxOrm admin
Hi,
With the macro QX_REGISTER_PRIMARY_KEY, you can change the default type of primary key : by default QxOrm uses a 'long' type.
To use a primary key based on 2 columns, you can define a pair type : "std::pair<T1, T2>", or "QPair<T1, T2>", or a tuple : "boost::tuple<T1, T2, T3, etc...>".
Re: Multi column primary index

Posted:
Wed Jan 05, 2011 8:09 am
by QxOrm admin
Sorry for my last answer, I think it shoudn't work with macro QX_REGISTER_PRIMARY_KEY.
Multi column primary index is not a feature provided by QxOrm 1.1.3.
Perhaps in QxOrm 1.1.4...
Re: Multi column primary index

Posted:
Sat Jan 08, 2011 11:45 am
by ruddy32
Is there some development started yet?
Re: Multi column primary index

Posted:
Sat Jan 08, 2011 1:49 pm
by QxOrm admin
I have written a new kind of smart pointer : qx::dao::ptr<T> based on QSharedPointer (Qt smart pointer).
This new smart pointer provides 2 new features :
1- a "isDirty()" method to know if an instance has been modified. You can also retrieve all properties changed.
2- "update optimized" to update in database only fields changed
Also, QxOrm 1.1.4 will support 3 strategies of inheritance :
1- Single Table Inheritance
2- Class Table Inheritance
3- Concrete Table Inheritance
Today, QxOrm 1.1.3 supports only "Concrete Table Inheritance" strategy.
This will be the new features provided by QxOrm 1.1.4...
I think this new version will be released current january...
Re: Multi column primary index

Posted:
Sat Jan 08, 2011 3:57 pm
by ruddy32
Does it means that multi-colomn index will be supported in 1.1.4 ? Both index and relations ?

I available for testing. Let me know.
Re: Multi column primary index

Posted:
Sun Jan 16, 2011 1:44 pm
by QxOrm admin
Thanks, I just release a new version : QxOrm 1.1.4.
You can test it if you want...
