Page 1 of 1

How to use set column unique?

PostPosted: Wed Mar 16, 2016 8:27 am
by staszek_dev
Hi,
I want to set my column as an unique. I call function setIsUnique() but it dosen`t work.

Code: Select all
t.data( & AMSJobEntity::m_strName, "name" )->setIsUnique( true );


How can I do this?

Similar setDefaultValue() function doesn`t work.

Re: How to use set column unique?

PostPosted: Wed Mar 16, 2016 4:36 pm
by qxorm
Hello,

setIsUnique(), setDefaultValue() ... doesn`t work

What do you mean with "doesn`t work" ?

If you mean : these parameters are not used to generate database schema, yes this is normal.
These 2 functions are just meta-data of your class/property for the introspection engine of QxOrm library.
And they are not used.

About schema generation, there is a section in QxOrm manual here : http://www.qxorm.com/qxorm_en/manual.html#manual_470
It is recommended to use QxEntityEditor or another tool dedicated to your SGBD to manage your database schema.