You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No demoiselle 2.3.1, a classe JPACrud implementa o seguinte método:
private CriteriaQuery createCriteriaByExample(final T example) {
final CriteriaBuilder builder = getCriteriaBuilder();
final CriteriaQuery query = builder.createQuery(getBeanClass());
final Root entity = query.from(getBeanClass());
final List predicates = new ArrayList();
final Field[] fields = example.getClass().getDeclaredFields();
for (Field field : fields) { if (!field.isAnnotationPresent(Column.class) && !field.isAnnotationPresent(Basic.class)
&& !field.isAnnotationPresent(Enumerated.class)) { continue; }
Object value = null;
try
{ field.setAccessible(true); value = field.get(example); }
No demoiselle 2.3.1, a classe JPACrud implementa o seguinte método:
private CriteriaQuery createCriteriaByExample(final T example) {
final CriteriaBuilder builder = getCriteriaBuilder();
final CriteriaQuery query = builder.createQuery(getBeanClass());
final Root entity = query.from(getBeanClass());
final List predicates = new ArrayList();
final Field[] fields = example.getClass().getDeclaredFields();
for (Field field : fields) {
if (!field.isAnnotationPresent(Column.class) && !field.isAnnotationPresent(Basic.class)
&& !field.isAnnotationPresent(Enumerated.class)) { continue; }
Object value = null;
try
{ field.setAccessible(true); value = field.get(example); }
catch (IllegalArgumentException e)
{ continue; } catch (IllegalAccessException e) { continue; }
if (value == null)
{ continue; }
final Predicate pred = builder.equal(entity.get(field.getName()), value);
predicates.add(pred);
}
return query.where(predicates.toArray(new Predicate[0])).select(entity);
}
No trecho em negrito, poderia ser incluída a anotação JoinColumn.
The text was updated successfully, but these errors were encountered: