divdat (5) [Avatar] Offline
#1
Why does the method

getProperty(String JavaDoc property)
throw a MissingPropertyException
if a properties value is NULL coming back from an query?

Yet, the method getAt(int index)
returns a string if it is NULL?

I can understand if the property itself doesn't exist in a List to throw the MissingPropertyException, but if the property exists, but the value is NULL, why not return the result.toString() as it does in the getAt method?

It makes it kind of convoluted to have to know if a property MIGHT be a null value in a database, and so you mix/match a println such as
for (i in 0..myList.size()-1) {
println myList[i].firstColumnIsAlwaysNotANull + " " + \r
myList[i].secondColumnMightBeNull //throws the Exception
}

vs.

for (i in 0..myList.size()-1) {
println myList[i].firstColumnIsAlwaysNotNull + " " + \r
myList[i][0]?.toString()
}

Thanks for your help.