Skip to content

How to create where clause

xjodoin edited this page Mar 14, 2013 · 1 revision

TorpedoQuery capture condition parameter automatically and put named parameter into the HQL query.

Entity entity = from(Entity.class);
where(entity.getCode()).eq("mycode");
org.torpedoquery.jpa.Query<Entity> select = select(entity);

If your query is suppose to return one result or nothing use the get() method

Entity result = select.get(entityManager);
Clone this wiki locally