test_class.declarator: baseJpaDaoImpl
test_class.modifier: @Autowired
      protected
test_class.original_string: @Autowired
      protected BaseJpaDaoImpl baseJpaDaoImpl;
test_class.type: BaseJpaDaoImpl
test_class.var_name: baseJpaDaoImpl
test_class.file: herd-code/herd-dao/src/test/java/org/finra/herd/dao/impl/BaseJpaDaoImplTest.java
test_class.identifier: BaseJpaDaoImplTest
test_class.superclass: extends AbstractDaoTest
test_case.body: @Test
      public void testGetPredicateForInClauseTwoChunks()
      {
          // Create the JPA builder, query, and entity root.
          CriteriaBuilder builder = entityManager.getCriteriaBuilder();
          CriteriaQuery<BusinessObjectDataEntity> criteria = builder.createQuery(BusinessObjectDataEntity.class);
          Root<BusinessObjectDataEntity> businessObjectDataEntity = criteria.from(BusinessObjectDataEntity.class);
  
          // Get the predicate for the "in" clause with 1001 values (1 greater than the default chunking size).
          Predicate predicate = baseJpaDaoImpl
              .getPredicateForInClause(builder, businessObjectDataEntity.get(BusinessObjectDataEntity_.partitionValue), getPartitionValueList(1001));
  
          // We expect to get back an "or" of 2 "in" expressions where each "in" expression is a list of chunked partition values.
          assertEquals(Predicate.BooleanOperator.OR, predicate.getOperator());
  
          List<Expression<Boolean>> expressions = predicate.getExpressions();
          assertEquals(2, expressions.size());
  
          // The first "in" clause will have the first 1000 elements and the second "in" clause will have the extra "1" element.
          assertEquals(1000, ((InPredicate) expressions.get(0)).getValues().size());
          assertEquals(1, ((InPredicate) expressions.get(1)).getValues().size());
      }
test_case.class_method_signature: BaseJpaDaoImplTest.testGetPredicateForInClauseTwoChunks()
test_case.full_signature: @Test public void testGetPredicateForInClauseTwoChunks()
test_case.identifier: testGetPredicateForInClauseTwoChunks
test_case.invocations: getCriteriaBuilder createQuery from getPredicateForInClause get getPartitionValueList assertEquals getOperator getExpressions assertEquals size assertEquals size getValues get assertEquals size getValues get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetPredicateForInClauseTwoChunks()
focal_class.declarator: entityManager
focal_class.modifier: @PersistenceContext
      protected
focal_class.original_string: @PersistenceContext
      protected EntityManager entityManager;
focal_class.type: EntityManager
focal_class.var_name: entityManager
focal_class.declarator: configurationHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ConfigurationHelper configurationHelper;
focal_class.type: ConfigurationHelper
focal_class.var_name: configurationHelper
focal_class.file: herd-code/herd-dao/src/main/java/org/finra/herd/dao/impl/BaseJpaDaoImpl.java
focal_class.identifier: BaseJpaDaoImpl
focal_class.interfaces: implements BaseJpaDao
focal_class.class_method_signature: BaseJpaDaoImpl.delete(T entity)
focal_class.full_signature: @Override public void delete(T entity)
focal_class.identifier: delete
focal_class.modifiers: @Override public
focal_class.parameters: (T entity)
focal_class.return: void
focal_class.signature: void delete(T entity)
focal_class.class_method_signature: BaseJpaDaoImpl.detach(T entity)
focal_class.full_signature: @Override public void detach(T entity)
focal_class.identifier: detach
focal_class.modifiers: @Override public
focal_class.parameters: (T entity)
focal_class.return: void
focal_class.signature: void detach(T entity)
focal_class.class_method_signature: BaseJpaDaoImpl.findAll(Class<T> entityClass)
focal_class.full_signature: @Override public List<T> findAll(Class<T> entityClass)
focal_class.identifier: findAll
focal_class.modifiers: @Override public
focal_class.parameters: (Class<T> entityClass)
focal_class.return: List<T>
focal_class.signature: List<T> findAll(Class<T> entityClass)
focal_class.class_method_signature: BaseJpaDaoImpl.findById(Class<T> entityClass, Object entityId)
focal_class.full_signature: @Override public T findById(Class<T> entityClass, Object entityId)
focal_class.identifier: findById
focal_class.modifiers: @Override public
focal_class.parameters: (Class<T> entityClass, Object entityId)
focal_class.return: T
focal_class.signature: T findById(Class<T> entityClass, Object entityId)
focal_class.class_method_signature: BaseJpaDaoImpl.findByNamedProperties(Class<T> entityClass, Map<String, ?> params)
focal_class.full_signature: @Override public List<T> findByNamedProperties(Class<T> entityClass, Map<String, ?> params)
focal_class.identifier: findByNamedProperties
focal_class.modifiers: @Override public
focal_class.parameters: (Class<T> entityClass, Map<String, ?> params)
focal_class.return: List<T>
focal_class.signature: List<T> findByNamedProperties(Class<T> entityClass, Map<String, ?> params)
focal_class.class_method_signature: BaseJpaDaoImpl.findUniqueByNamedProperties(Class<T> entityClass, Map<String, ?> params)
focal_class.full_signature: @Override public T findUniqueByNamedProperties(Class<T> entityClass, Map<String, ?> params)
focal_class.identifier: findUniqueByNamedProperties
focal_class.modifiers: @Override public
focal_class.parameters: (Class<T> entityClass, Map<String, ?> params)
focal_class.return: T
focal_class.signature: T findUniqueByNamedProperties(Class<T> entityClass, Map<String, ?> params)
focal_class.class_method_signature: BaseJpaDaoImpl.getCurrentTimestamp()
focal_class.full_signature: @Override public Timestamp getCurrentTimestamp()
focal_class.identifier: getCurrentTimestamp
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Timestamp
focal_class.signature: Timestamp getCurrentTimestamp()
focal_class.class_method_signature: BaseJpaDaoImpl.getEntityManager()
focal_class.full_signature: @Override public EntityManager getEntityManager()
focal_class.identifier: getEntityManager
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: EntityManager
focal_class.signature: EntityManager getEntityManager()
focal_class.class_method_signature: BaseJpaDaoImpl.query(String queryString)
focal_class.full_signature: @SuppressWarnings({"unchecked"}) @Override public List<T> query(String queryString)
focal_class.identifier: query
focal_class.modifiers: @SuppressWarnings({"unchecked"}) @Override public
focal_class.parameters: (String queryString)
focal_class.return: List<T>
focal_class.signature: List<T> query(String queryString)
focal_class.class_method_signature: BaseJpaDaoImpl.queryByNamedParams(String queryString, Map<String, ?> params)
focal_class.full_signature: @Override public List<T> queryByNamedParams(String queryString, Map<String, ?> params)
focal_class.identifier: queryByNamedParams
focal_class.modifiers: @Override public
focal_class.parameters: (String queryString, Map<String, ?> params)
focal_class.return: List<T>
focal_class.signature: List<T> queryByNamedParams(String queryString, Map<String, ?> params)
focal_class.class_method_signature: BaseJpaDaoImpl.save(T entity)
focal_class.full_signature: @Override public T save(T entity)
focal_class.identifier: save
focal_class.modifiers: @Override public
focal_class.parameters: (T entity)
focal_class.return: T
focal_class.signature: T save(T entity)
focal_class.class_method_signature: BaseJpaDaoImpl.saveAndRefresh(T entity)
focal_class.full_signature: @Override public T saveAndRefresh(T entity)
focal_class.identifier: saveAndRefresh
focal_class.modifiers: @Override public
focal_class.parameters: (T entity)
focal_class.return: T
focal_class.signature: T saveAndRefresh(T entity)
focal_class.class_method_signature: BaseJpaDaoImpl.executeSingleResultQuery(CriteriaQuery<T> criteria, String message)
focal_class.full_signature: protected T executeSingleResultQuery(CriteriaQuery<T> criteria, String message)
focal_class.identifier: executeSingleResultQuery
focal_class.modifiers: protected
focal_class.parameters: (CriteriaQuery<T> criteria, String message)
focal_class.return: T
focal_class.signature: T executeSingleResultQuery(CriteriaQuery<T> criteria, String message)
focal_class.class_method_signature: BaseJpaDaoImpl.getPredicateForInClause(CriteriaBuilder builder, Path<T> path, List<T> values)
focal_class.full_signature: protected Predicate getPredicateForInClause(CriteriaBuilder builder, Path<T> path, List<T> values)
focal_class.identifier: getPredicateForInClause
focal_class.modifiers: protected
focal_class.parameters: (CriteriaBuilder builder, Path<T> path, List<T> values)
focal_class.return: Predicate
focal_class.signature: Predicate getPredicateForInClause(CriteriaBuilder builder, Path<T> path, List<T> values)
focal_class.class_method_signature: BaseJpaDaoImpl.executeQueryWithNamedParams(Query query, Map<String, ?> params)
focal_class.full_signature: @SuppressWarnings({"unchecked"}) private List<T> executeQueryWithNamedParams(Query query, Map<String, ?> params)
focal_class.identifier: executeQueryWithNamedParams
focal_class.modifiers: @SuppressWarnings({"unchecked"}) private
focal_class.parameters: (Query query, Map<String, ?> params)
focal_class.return: List<T>
focal_class.signature: List<T> executeQueryWithNamedParams(Query query, Map<String, ?> params)
focal_method.body: protected <T> Predicate getPredicateForInClause(CriteriaBuilder builder, Path<T> path, List<T> values)
      {
          // Get the chunk size from the environment and use a default as necessary.
          int inClauseChunkSize = configurationHelper.getProperty(ConfigurationValue.DB_IN_CLAUSE_CHUNK_SIZE, Integer.class);
  
          // Initializes the returned predicate and the value list size.
          Predicate predicate = null;
          int listSize = values.size();
  
          // Loop through each chunk of values until we have reached the end of the values.
          for (int i = 0; i < listSize; i += inClauseChunkSize)
          {
              // Get a sub-list for the current chunk of data.
              List<T> valuesSubList = values.subList(i, (listSize > (i + inClauseChunkSize) ? (i + inClauseChunkSize) : listSize));
  
              // Get an updated predicate which will be the "in" clause of the sub-list on the first loop or the "in" clause of the sub-list "or"ed with the\
              // previous sub-list "in" clause.
              predicate = (predicate == null ? path.in(valuesSubList) : builder.or(predicate, path.in(valuesSubList)));
          }
  
          // Return the "in" clause predicate.
          return predicate;
      }
focal_method.class_method_signature: BaseJpaDaoImpl.getPredicateForInClause(CriteriaBuilder builder, Path<T> path, List<T> values)
focal_method.full_signature: protected Predicate getPredicateForInClause(CriteriaBuilder builder, Path<T> path, List<T> values)
focal_method.identifier: getPredicateForInClause
focal_method.invocations: getProperty size subList in or in
focal_method.modifiers: protected
focal_method.parameters: (CriteriaBuilder builder, Path<T> path, List<T> values)
focal_method.return: Predicate
focal_method.signature: Predicate getPredicateForInClause(CriteriaBuilder builder, Path<T> path, List<T> values)