1. create a simple virtual table with a composite primary key (i used bqt)
2. right click on the model -> modeling -> generate REST virtual procedures -> choose the virtual table
3. preview the results. it will ask the input values with correct field names
4. add the model to the vdb file and deploy it
5. right click on the vdb file -> modeling -> generate rest war
6. deploy the rest war
access it on the browser:
<host>:<port>/<context-root-of-rest-war>
when I input the values to the field, exceptions were returned and I got the TEIID30082 Expected value of type 'date' but ''008005530'' is of type 'string' and no implicit conversion is available.
It replaced the string input field with the date input field and vice-versa.
pk_datevalue_in should be date, and it is accepting string only
pk_stringnum_in should be string, and it is accepting date only
the test page shows the 2 parameters, date and string, I entered the string value in the date field and vice versa, when using the URL, my json response shows the pk_datevalue_in as the date I entered into the pk_stringnum_in and vice versa.
Parameters
Parameter Value Description Parameter Type Data Type
pk_datevalue_in 2 pk_datevalue_in path string
pk_stringnum_in 2000-01-27 pk_stringnum_in path string
Request URL
http://localhost:8080/GP/gp_virt/json/gp_test/2/2000-01-27
{"elems": {
"elem":
{
"doublenum": "2",
"booleanvalue": "false",
"intnum": "2",
"longnum": "2",
"floatnum": "2",
"bytenum": "-102",
"stringkey": "26",
"objectvalue": "2",
"stringnum": "2",
"bigintegervalue": "2",
"datevalue": "2000-01-27Z",
"timevalue": "08:00:00Z",
"timestampvalue": "2000-01-01T06:00:26Z",
"bigdecimalvalue": "2",
"intkey": "26",
"shortvalue": "-32742"
}
,
"pk_datevalue_in": "2000-01-27Z",
"pk_stringnum_in": "2"
}}