On Mon, Jan 9, 2017 at 7:54 AM, Isuru Haththotuwa <[email protected]> wrote:
> > > On Fri, Jan 6, 2017 at 5:19 PM, Uvindra Dias Jayasinha <[email protected]> > wrote: > >> Setting a default value for empty fields being sent seems to be best. >> >> Furthermore we can have default values set in our DTO objects in case a >> given field is omitted altogether. >> >> So handling both the above scenarios can overcome the limitation in >> Oracle. >> >> But I dont know if this is good for the REST API user experience, when >> retrieving data that contains these default values. >> > Additionally this could affect the user experience in UIs as well. > > How about we just keep a default value to NULL in DB level and then filter > it from UI? Since anyway Oracle treats zero length String as NULLs, even if > the user enters an empty String it will then be automatically. The rest API > will still return the default value if invoked directly though. > s/automatically/automatically filtered/g > >> On 6 January 2017 at 15:28, Tharindu Dharmarathna <[email protected]> >> wrote: >> >>> >>> >>> On Fri, Jan 6, 2017 at 3:26 PM, Tharindu Dharmarathna < >>> [email protected]> wrote: >>> >>>> Hi All, >>>> >>>> I faced $Subject in Oracle database while running integration test on >>>> C5 on top. >>>> >>>> *Observation* >>>> >>>> when insert empty string ("") it was save as null in database. >>>> >>>> While going through SO I had found [1] , which did happen in oracle >>>> database. >>>> >>>> >>>> We have come up with several ways to handle empty strings which user >>>> sends through the rest api. >>>> >>>> 1. Validate the request and send error when giving empty strings >>>> 2. Set default value like "N/A" into the fields which send as empty. >>>> >>>> Is there any other way to handle this problem ?. >>>> >>>> [1] - http://stackoverflow.com/questions/13278773/null-vs-empty- >>>> string-in-oracle >>>> >>>> Thanks >>>> >>>> >>>> *Tharindu Dharmarathna*Software Engineer >>>> WSO2 Inc.; http://wso2.com >>>> lean.enterprise.middleware >>>> >>>> mobile: *+94779109091 <+94%2077%20910%209091>* >>>> >>> >>> >>> >>> -- >>> >>> *Tharindu Dharmarathna*Software Engineer >>> WSO2 Inc.; http://wso2.com >>> lean.enterprise.middleware >>> >>> mobile: *+94779109091 <+94%2077%20910%209091>* >>> >> >> >> >> -- >> Regards, >> Uvindra >> >> Mobile: 777733962 >> > > > > -- > Thanks and Regards, > > Isuru H. > +94 716 358 048 <071%20635%208048>* <http://wso2.com/>* > > > -- Thanks and Regards, Isuru H. +94 716 358 048* <http://wso2.com/>*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
