org.datanucleus.store.query.QueryCompilerSyntaxException: Identifier expected at character 12 in "u.username== value"
here is the query I'm trying to Execute :
try{
Query q=em.createQuery("select u from UserJ u where u."+key+"== value");
q.setParameter("value",value );
return q.getResultList().isEmpty();
}
catch(PersistenceException x)
{
System.out.println(x.getLocalizedMessage());}
finally{
em.close();
}
Where is key
is passed by value :"username"
and value
is passed by value :"test"