jpa - jpql replaces 1 with? -


trying find way around integer being replaced "?".

sql works expected:

select max(m.ticket_num) **+ 1** mytable m current date = date(m.create_ts) 

jpql:

@namedquery(       name = "orders.findnewticketnum",        query = "select max(m.ticketnum) **+ 1** mytable m current_date = function('date',m.createts)") 

printing out query before execution shows:

ejbqueryimpl(         reportquery(          name="mytable.findnewticketnum"           referenceclass=mytable           sql="select (max(ticket_num) **+ ?**) mytable (current_date = date(create_ts))")) 

the "+ 1" changed "+ ?" , application hangs on initial run of query. can around adding 1 in code, know if missing something. looks "1" being parse indexed placeholder , thought syntax was: "?1".

i looked @ escaping "1", think applies "like" clauses. ... + \1 ... result "1" removed in final sql.

i tried using named parameter of type integer, replaced "?".

is there way add constant value in jpql?


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -