use of com.querydsl.jpa.JPQLSerializer in project querydsl by querydsl.
the class JPADeleteClause method toString.
@Override
public String toString() {
JPQLSerializer serializer = new JPQLSerializer(templates, entityManager);
serializer.serializeForDelete(queryMixin.getMetadata());
return serializer.toString();
}
use of com.querydsl.jpa.JPQLSerializer in project querydsl by querydsl.
the class JPAUpdateClause method execute.
@Override
public long execute() {
JPQLSerializer serializer = new JPQLSerializer(templates, entityManager);
serializer.serializeForUpdate(queryMixin.getMetadata(), updates);
Map<Object, String> constants = serializer.getConstantToLabel();
Query query = entityManager.createQuery(serializer.toString());
if (lockMode != null) {
query.setLockMode(lockMode);
}
JPAUtil.setConstants(query, constants, queryMixin.getMetadata().getParams());
return query.executeUpdate();
}
use of com.querydsl.jpa.JPQLSerializer in project querydsl by querydsl.
the class HibernateDeleteClause method execute.
@Override
public long execute() {
JPQLSerializer serializer = new JPQLSerializer(templates, null);
serializer.serializeForDelete(queryMixin.getMetadata());
Map<Object, String> constants = serializer.getConstantToLabel();
Query query = session.createQuery(serializer.toString());
for (Map.Entry<Path<?>, LockMode> entry : lockModes.entrySet()) {
query.setLockMode(entry.getKey().toString(), entry.getValue());
}
HibernateUtil.setConstants(query, constants, queryMixin.getMetadata().getParams());
return query.executeUpdate();
}
use of com.querydsl.jpa.JPQLSerializer in project querydsl by querydsl.
the class HibernateUpdateClause method execute.
@Override
public long execute() {
JPQLSerializer serializer = new JPQLSerializer(templates, null);
serializer.serializeForUpdate(queryMixin.getMetadata(), updates);
Map<Object, String> constants = serializer.getConstantToLabel();
Query query = session.createQuery(serializer.toString());
for (Map.Entry<Path<?>, LockMode> entry : lockModes.entrySet()) {
query.setLockMode(entry.getKey().toString(), entry.getValue());
}
HibernateUtil.setConstants(query, constants, queryMixin.getMetadata().getParams());
return query.executeUpdate();
}
Aggregations