Thursday, 15 March 2012

java - HQL, can I parameterize the FROM clause? -



java - HQL, can I parameterize the FROM clause? -

i have hql query:

query q = em.createquery ( "delete annotation a.id in ( " + " select ja.id :entityname bring together an.annotations ja)" );

and i'm beingness told: querysyntaxexception: unexpected token: : near line 1 have hope of making entity name after parameter? have list of entities send query , i'm afraid string concatenation slow.

you can't substitute entity name parameters work entity properties not instead.

you select entities ids deleted 1 query , pass them sec delete query, read_commited transaction isolation might still end else inserting 1 kid entity have matched query. serializable solve issue.

java hibernate jpa hql hsqldb

No comments:

Post a Comment