0

What is the meaning of "?1" actually. Can someone explain to me.Thanks in advance.

Example code:

(SQL.append(" SELECT ComModules.id, ComModules.description ")
                        .append(" FROM ComAccessModules as ComAccessModules, ComModules as ComModules ")
                        .append(" WHERE ")
                        .append(" ComAccessModules.comAccessModulesPK.modId=ComModules.id ")
                        .append(" AND ")
                        .append(" ComAccessModules.comAccessModulesPK.accessId=?1 ")))
Aleksandr M
  • 24,264
  • 12
  • 69
  • 143
mehann
  • 1
  • 2
  • ?1 is just the parameter , as is rendered in HQL – Satya Apr 19 '16 at 09:01
  • Before executing this statement you should add a value to replace the ?1 in the query. See this [answer](http://stackoverflow.com/a/2309984/5118375) about using parameterized queries. Furthermore read up on sql injection and how to prevent it. – cvetanov Apr 19 '16 at 09:07

2 Answers2

0

Should be a placeholder that gets filled with whatever you give it as parameter at execution of the statement.

Vampire
  • 35,631
  • 4
  • 76
  • 102
0

The ? is an unnamed parameter which can be filled in by a program running the query. :)

serendipity
  • 103
  • 1
  • 10