Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
Issue imixs#634
  • Loading branch information
rsoika committed Jan 28, 2020
1 parent 1739c8c commit c03cbf5
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -902,11 +902,16 @@ public List<ItemCollection> findDocumentsByRef(String uniqueIdRef, int pageSize,
/**
* Returns an unordered list of all documents of a specific type. The method
* throws an InvalidAccessException in case no type attribute is defined.
* <p>
* The Transactiontype REQUIRES_NEW ensure that during the processing lifecycle
* an external service call did not overwrite the current document jpa object
* (see Issue #634)
*
* @param type
* @return
* @throws InvalidAccessException
*/
@TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW)
public List<ItemCollection> getDocumentsByType(String type) {
if (type == null || type.isEmpty()) {
throw new InvalidAccessException(INVALID_PARAMETER, "undefined type attribute");
Expand All @@ -920,36 +925,51 @@ public List<ItemCollection> getDocumentsByType(String type) {

/**
* Returns all documents of by JPQL statement
* <p>
* The Transactiontype REQUIRES_NEW ensure that during the processing lifecycle
* an external service call did not overwrite the current document jpa object
* (see Issue #634)
*
* @param query - JPQL statement
* @return
*
*/
@TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW)
public List<ItemCollection> getDocumentsByQuery(String query) {
return getDocumentsByQuery(query, -1);

}

/**
* Returns all documents of by JPQL statement.
* <p>
* The Transactiontype REQUIRES_NEW ensure that during the processing lifecycle
* an external service call did not overwrite the current document jpa object
* (see Issue #634)
*
* @param query - JPQL statement
* @param maxResult - maximum result set
* @return
*
*/
@TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW)
public List<ItemCollection> getDocumentsByQuery(String query, int maxResult) {
return getDocumentsByQuery(query, 0, maxResult);
}

/**
* Returns all documents of by JPQL statement.
* <p>
* The Transactiontype REQUIRES_NEW ensure that during the processing lifecycle
* an external service call did not overwrite the current document jpa object
* (see Issue #634)
*
* @param query - JPQL statement
* @param maxResult - maximum result set
* @return
*
*/
@TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW)
public List<ItemCollection> getDocumentsByQuery(String query, int firstResult, int maxResult) {
boolean debug = logger.isLoggable(Level.FINE);
List<ItemCollection> result = new ArrayList<ItemCollection>();
Expand Down

0 comments on commit c03cbf5

Please sign in to comment.