Issue Details (XML | Word | Printable)

Key: DBUTILS-34
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dan Fabulich
Reporter: Fabio Insaccanebbia
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Commons DbUtils

BasicRowProcessor loses any information on database field case

Created: 01/Dec/06 08:54 PM   Updated: 07/Mar/09 06:09 AM
Return to search
Component/s: None
Affects Version/s: 1.0
Fix Version/s: 1.2

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works BasicRowProcessor.java 2007-05-11 03:41 PM Julien Aymé 8 kB
Text File Licensed for inclusion in ASF works BasicRowProcessor.patch 2007-05-11 03:41 PM Julien Aymé 4 kB

Resolution Date: 25/Feb/09 10:06 AM


 Description  « Hide
In the BasicRowProcessor class there is a comment about the toMap method:
" This implementation returns a <code>Map</code> with case insensitive column names as keys. Calls to map.get("COL") and map.get("col") return the same value"

So the "contract" of this method just says that the "get" method is case insensitive. The current implementation obtains this result by putting all the keys in lowercase. This way we simply "lose" every information about the case of the fields. If you call the "keys" iterator, you don't have anymore the keys you inserted, but the "lowercase" version.

I find it not completely correct: I would expect the keys to be exactly the ones I set on the database, also if I can get the value in a case insensitive way.
I still have to find the idea for a pathc, but I'd like to know if you find my reasoning correct.

I consider the current behaviour a problem, since I had to map the database fields to a bean and the "case" made it impossible, even if I had set my database to return mixed case fieldnames.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.