@Test public void setNamedParameterArray() { org.hibernate.query.Query query = mock(org.hibernate.query.Query.class); String name = "bar"; Integer[] value = new Integer[] { 1, 2, 3 }; this.executor.setNamedParameter(query, name, value); verify(query).setParameterList(name, value); }
protected void setNamedParameter(org.hibernate.query.Query<?> query, String name, Object value) { if (value instanceof Collection) { query.setParameterList(name, (Collection<?>) value); } else if (value.getClass().isArray()) { query.setParameterList(name, (Object[]) value); } else { query.setParameter(name, value); } }
HqlQueryExecutor implements QueryExecutor, Initializable { protected void setNamedParameter(org.hibernate.query.Query<?> query, String name, Object value) { if (value instanceof Collection) { query.setParameterList(name, (Collection<?>) value); } else if (value.getClass().isArray()) { query.setParameterList(name, (Object[]) value); } else { query.setParameter(name, value); } } }
HqlQueryExecutor implements QueryExecutor, Initializable { protected void setNamedParameter(org.hibernate.query.Query<?> query, String name, Object value) { if (value instanceof Collection) { query.setParameterList(name, (Collection<?>) value); } else if (value.getClass().isArray()) { query.setParameterList(name, (Object[]) value); } else { query.setParameter(name, value); } }  }
HqlQueryExecutor implements QueryExecutor, Initializable { protected void setNamedParameter(org.hibernate.query.Query<?> query, String name, Object value) { if (value instanceof Collection) { query.setParameterList(name, (Collection<?>) value); } else if (value.getClass().isArray()) { query.setParameterList(name, (Object[]) value); } else { query.setParameter(name, value); } }  @Override void initialize(); @Override List<T> execute(final Query query); }
HqlQueryExecutor implements QueryExecutor, Initializable { protected void setNamedParameter(org.hibernate.query.Query<?> query, String name, Object value) { if (value instanceof Collection) { query.setParameterList(name, (Collection<?>) value); } else if (value.getClass().isArray()) { query.setParameterList(name, (Object[]) value); } else { query.setParameter(name, value); } }  @Override void initialize(); @Override List<T> execute(final Query query);  }