Relation ManyToOne and qx::dao::insert_with_all_relation

You find a bug using QxOrm library and you know how to fix it : submit a patch on this forum

Relation ManyToOne and qx::dao::insert_with_all_relation

Postby Davita » Tue Apr 03, 2012 11:28 am

Hi
Is there any way we can pull change requests to a central repository? or how should we contribute to this wonderful project? :)
I just debugged and fixed this bug viewtopic.php?f=2&t=102 <--. The problem was that, when persisting an object with manyToOne relationship, the object is saved before it's relationship, which caused id mismatch.
here's the fixed QxSqlRelation_ManyToOne.h file: http://dl.dropbox.com/u/3055964/QxSqlRe ... anyToOne.h
I run qxBlog test and several of my test cases and looks like it's working.
This is a fix for QxOrm 1.2.2. I will download latest version and fix that too.

Thanks
Davita
 

Re: Where should we report patches/contributions?

Postby QxOrm admin » Tue Apr 03, 2012 12:37 pm

Hi,

Thanx for your patch, I will execute some tests and include it for the next version of QxOrm library (1.2.4)...

Is there any way we can pull change requests to a central repository? or how should we contribute to this wonderful project?

You can create a new thread on this forum or you can send me a mail at : contact@qxorm.com.

About your patch : does it work well when your m_District property is set to NULL before inserting with all relations a City ?
QxOrm admin
 

Re: Where should we report patches/contributions?

Postby Davita » Tue Apr 03, 2012 6:38 pm

Hmm, you are right, I didn't test with nulls. It definitely has issues and not only the version I sent you.
Looks like it's not possible to save an entity with all_relation, not with my patch, not with unpatched :)
This looks like another bug. I will try to solve it :)

Thanks for the hint :)
Davita
 

Re: Where should we report patches/contributions?

Postby Davita » Tue Apr 03, 2012 6:47 pm

Sorry, just to make it clear. It is possible to save an entity with all_relation, it is not possible to save that entity's relation as NULL in database with all_relation.
In this case, if I initialize to NULL m_District's smart pointer, QxOrm will create a row for it, no matter it is null or not.
Davita
 

Re: Where should we report patches/contributions?

Postby QxOrm admin » Wed Apr 04, 2012 12:03 pm

Here is a first BETA version of QxOrm 1.2.4 :
http://www.qxorm.com/version/QxOrm_1.2.4_BETA_02.zip

You can download it : this version includes your patch and should have the good behaviour even if your m_District property is set to NULL before calling qx::dao::insert_with_all_relation() function.
Please let me know if all works fine for you with this BETA ;)
QxOrm admin
 

Re: Where should we report patches/contributions?

Postby Davita » Wed Apr 04, 2012 5:53 pm

Very nice you came up with a solution in this short time. I tried to find out the problem yesterday, but my try didn't yield any results, probably due to the lack of skills in C++ :)
Thank you very much, I will try soon and let you know the result
Davita
 

Re: Where should we report patches/contributions?

Postby QxOrm admin » Thu Apr 05, 2012 7:12 am

Ok, I will wait for your results.
I created a new forum called "Submit a patch" : I will move this discussion into the new forum...
QxOrm admin
 

Re: Where should we report patches/contributions?

Postby Davita » Thu Apr 05, 2012 10:30 am

I just tested it and it works flawlessly :)
Thank you for your commitment. I will continue development on my project, and in case I find anything, I'll try to fix it, otherwise I'll notify about the issue :)
Davita
 


Return to QxOrm - Submit a patch

Who is online

Users browsing this forum: No registered users and 2 guests

cron