Page 1 of 1

qxBlog Bug in ODBC/MS SQL/ QxORM in commercial application

PostPosted: Thu Apr 12, 2012 12:12 pm
by Gennadiy
I am looking for a good ORM for our commercial application. That's why I am here with QxORM.
I tried to build and run qxBlog application from the tutorial against ODBC driver to MS SQL Server.
The first create table operator generated by (qx::dao::create_table<author>();) was translated to the following SQL command:
CREATE TABLE author (author_id TEXT NOT NULL PRIMARY KEY, name TEXT, birthdate DATE, sex INTEGER)
That is wrong for MS SQL: Column 'author_id' in table 'author' is of a type that is invalid for use as a key column in an index.

I am disappointed...

So my question: have anybody used QxORM in commercial applications? What ist your experience?

Re: qxBlog Bug in ODBC/MS SQL/ QxORM in commercial application

PostPosted: Thu Apr 12, 2012 12:40 pm
by QxOrm admin
Hi,

The function qx::dao::create_table is just used to build prototype using SQLite database.
This function must not be used for a commercial application : just to create quick examples.
All other SQL queries (SELECT, INSERT, UPDATE, DELETE) should work correctly with MS SQL Server.

To create your SQL schema, I strongly recommend to use a tool provided by your SGBD.
But you can also write your own function using introspection engine of QxOrm library, it's quite easy to do, you have an example provided by dodobibi for a commercial application using a PostgreSQL database : http://www.qxorm.com/qxorm_en/faq.html#faq_230
You can also see another example with the function qx::QxClassX::dumpSqlSchema() : http://www.qxorm.com/qxorm_en/resource/ ... chema.html

have anybody used QxORM in commercial applications?

Yes you can find some examples of commercial application (using SQLite, MySQL, PostgreSQL and Oracle) into this forum and the french forum here : http://www.developpez.net/forums/f1563/ ... ues/qxorm/
But for MS SQL Server, I don't know (but I'm pretty sure yes).

Anyway, QxOrm library builds standard SQL queries (except for table creation), and if MS SQL Server supports standard SQL queries, it will be no problem (there is a SQL generator for database specific cases : http://www.qxorm.com/doxygen/html/dir_6 ... 0e447.html).
Using ODBC driver (this is your case), you must define this SQL generator like this :
Code: Select all
qx::QxSqlDatabase::getSingleton()->setSqlGenerator(new qx::dao::detail::QxSqlGenerator_MSSQLServer());

Re: qxBlog Bug in ODBC/MS SQL/ QxORM in commercial application

PostPosted: Thu Apr 12, 2012 1:35 pm
by Gennadiy
Hi admin,

I am probably too spoiled with Hibernate...
and thank you for your really fast answer!
Cheers,
Gennadiy