Query Builder Emits Warning on Trim

Questions, tips and tricks and techniques for scripting in Servoy

Query Builder Emits Warning on Trim

Postby kwpsd » Fri Dec 29, 2017 9:37 pm

Servoy 8.2.1
JRE 1.8.0_121

The following query builder code emits a warning in the Debug Console when getDataSetByQuery() is executed:

Code: Select all
    var query = datasources.db.arm_data.supplies_inventory.createSelect()
             
    query.result.add( query.columns.inventory_item_description.trim )
   
    var ds = databaseManager.getDataSetByQuery( query, -1 )  // WARNING APPEARS WHEN THIS LINE OF CODE IS EXECUTED


Here is the warning message (the message is shown twice for each instance of getDataSetByQuery()):

WARN org.hibernate.dialect.function.TemplateRenderer - Function template anticipated 1 arguments, but 4 arguments encountered
WARN org.hibernate.dialect.function.TemplateRenderer - Function template anticipated 1 arguments, but 4 arguments encountered


If trim is removed from the code, no warning is emitted. I don't know what to make of the '4 arguments encountered' part of the message. Is this a bug?
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 589
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: Query Builder Emits Warning on Trim

Postby kwpsd » Mon Jan 08, 2018 9:10 pm

Servoy...what is the correct usage of trim vs. trim() function in order to suppress the '4 arguments' warning message? I presume the '4 arguments' pertains to the trim() function but not the trim chain element...correct? So, why does the chain element trim emit a warning message regarding arguments when there are no arguments involved? My assumption is that the chain element trim removes all leading and trailing white space whereas the trim() function allows for removing leading only, trailing only, or both leading and trailing white space.

tooltip_trim.png
tooltip_trim.png (13.35 KiB) Viewed 293 times


double_trim.png
double_trim.png (44.34 KiB) Viewed 293 times
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 589
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA


Return to Methods

Who is online

Users browsing this forum: No registered users and 2 guests

cron