java spring named query and property file -


how use named query. example:

public interface extends base<someclass, long> {    @query(value = "select sum(d.is_open) vw_view d d.value=?1", nativequery = true)    someclass getvalue(long value); } 

how can save sql query properties file (not xml, not in java class) , send name parameter?

could proceed example:

this generic select query on basis of primary key

query1=select {0} {1} {2} = {3} 

then can @ time of retrieving query can use this

 property = messageformat.format(query1,new string[]{"org_id","organization","primary-key","454545452"}); 

similarly can generalize queries , set values in java code. depends on level of generalization want.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -