sql - Collate hint on QueryDSL- JPA -


there way execute querydsl? (bold part):

select * venue name '%cafe%' collate latin1_general_ci_ai

i using jpa hibernate.

you can use addflag(queryflag.position position, string flag) method, documented here.

something similar following should want:

query.addflag(queryflag.position.end, "collate latin1_general_ci_ai"); 

in response question, if require solution supports more 1 predicate, use booleantemplate's create(string template, object one) method, documented here.

something similar following should want:

booleantemplate.create("{0} collate latin1_general_ci_ai", venue.name.like("%cafe%")); 

your query should like:

query .from(venue) .where(booleantemplate.create("{0} collate latin1_general_ci_ai", venue.name.like("%cafe%")) .and(booleantemplate.create("{0} collate latin1_general_ci_ai", venue.name2.like("%milk%")))) .list(venue.name, venue.name2); 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -