Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Case-sensitivity in SQL binding
Case-sensitivity in SQL binding [message #1405026] Wed, 06 August 2014 12:01 Go to next message
Dennis Geesen is currently offline Dennis GeesenFriend
Messages: 46
Registered: June 2014
Member
Hi,

It is more a disscusible topic than a problem, because I'm aware why and how it is working. However, I often get the same "error", which has to do with the case-sensitivity in the SQL binding.

Following example:
I have a field called "VAT" and the according "getVAT()" and "setVAT()" methods in the form data class.

So, the following call is used to load the data:

SQL.selectInto("SELECT vat FROM ITEMS "
        + " WHERE id = :id "
        + "INTO "
        + ":VAT",
        formData);


Since Java ist case-sensitive, I would normally aggree that ":VAT" is the way how to define the bind name, because the methods for VAT are also capitalized.
According to this case-sensitivity, :VAT/getVAT()/setVAT() is not the same like :Vat/getVat()/setVat() or :vat/getvat()/setvat().

That's ok and comprehensible!

However, the following one is working too for getVAT()/setVAT:

SQL.selectInto("SELECT vat FROM ITEMS "
        + " WHERE id = :id "
        + "INTO "
        + ":vAT",
        formData);

This is obviously due to the special handling of the first character...

Now my question: why this? It should be either completely case-sensitive or not.
Is there a certain reason fot this special handling?

Since my MySQL instances are running case-insensitive too and fields/propertys with the same name (regardless of the sensitivity) are not a good idea (in my tests there were also some resolving problems when using same fields with different capitalizations), I would appreciate to use also case-insensitivity for SQL binding in Scout (:vat and :VAT are the same). Or switching this on/off would be nice?! Or is this already possible?!




Re: Case-sensitivity in SQL binding [message #1411125 is a reply to message #1405026] Fri, 22 August 2014 13:03 Go to previous messageGo to next message
Adrian Sacchi is currently offline Adrian SacchiFriend
Messages: 10
Registered: January 2013
Junior Member
Hi Dennis,

The mechanism that matches SQL binds to getters in the formdata is generally case sensitive. While it always expects a JavaBeans style getter in the formdata (with an uppercase letter after "get") it is lenient with the case of the first (and only the first) letter of the bind in the SQL-String. At the moment there are no intentions to change something about this.

However while looking into the subject I found two issues for which I opened bugs:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=442371
https://bugs.eclipse.org/bugs/show_bug.cgi?id=442375

Regards,
Adrian
Re: Case-sensitivity in SQL binding [message #1412053 is a reply to message #1411125] Mon, 25 August 2014 07:16 Go to previous messageGo to next message
Dennis Geesen is currently offline Dennis GeesenFriend
Messages: 46
Registered: June 2014
Member
Hi,

I was not thinking about JavaBeans while writing the post. I agree with you that from this point of view, case-sensitive is the correct way.
I am therefore satisfied with your two bugs and that there is a mechanism that prevents or warns if there naming (e.g. no bean-styled classes) problems.


Furthermore: Thanks for the bug report - until now I did not know that there is an auto completion for SQL binds Smile
Re: Case-sensitivity in SQL binding [message #1434766 is a reply to message #1412053] Tue, 30 September 2014 15:03 Go to previous message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 232
Registered: September 2011
Senior Member
Bugs updated with some details and fixed for the Mars M2 build.

Thanks for reporting this.
Previous Topic:@InputValidation and validation rules
Next Topic:miniCRM Tutorial...for JPA folks
Goto Forum:
  


Current Time: Thu Apr 25 11:51:18 GMT 2024

Powered by FUDForum. Page generated in 0.03665 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top