use of org.hibernate.envers.internal.entities.RevisionTypeType in project hibernate-orm by hibernate.
the class TypeContributorImpl method contribute.
@Override
public void contribute(TypeContributions typeContributions, ServiceRegistry serviceRegistry) {
final EnversService enversService = serviceRegistry.getService(EnversService.class);
if (!enversService.isEnabled()) {
return;
}
typeContributions.contributeType(new RevisionTypeType(), new String[] { RevisionTypeType.class.getName() });
}
use of org.hibernate.envers.internal.entities.RevisionTypeType in project hibernate-orm by hibernate.
the class QueryBuilder method toQuery.
public Query toQuery(Session session) {
final StringBuilder querySb = new StringBuilder();
final Map<String, Object> queryParamValues = new HashMap<>();
build(querySb, queryParamValues);
final Query query = session.createQuery(querySb.toString());
for (Map.Entry<String, Object> paramValue : queryParamValues.entrySet()) {
if (paramValue.getValue() instanceof RevisionType) {
// this is needed when the ClassicQueryTranslatorFactory is used
query.setParameter(paramValue.getKey(), paramValue.getValue(), new CustomType(new RevisionTypeType()));
} else {
query.setParameter(paramValue.getKey(), paramValue.getValue());
}
}
return query;
}
Aggregations