• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

common-workflow-language / cwlviewer / #1801

31 Mar 2025 07:01AM UTC coverage: 70.087% (-0.2%) from 70.306%
#1801

Pull #692

github

kinow
Make test non-transactional (DtaJpaTest does it) but start a transaction when deleting (extended persistence context requires it now?)
Pull Request #692: Fixing bytea json conversion error (update to hibernate 6, spring 3)

12 of 20 new or added lines in 2 files covered. (60.0%)

1701 of 2427 relevant lines covered (70.09%)

0.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

12.5
/src/main/java/org/commonwl/view/workflow/WorkflowRepositoryImpl.java
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one
3
 * or more contributor license agreements.  See the NOTICE file
4
 * distributed with this work for additional information
5
 * regarding copyright ownership.  The ASF licenses this file
6
 * to you under the Apache License, Version 2.0 (the
7
 * "License"); you may not use this file except in compliance
8
 * with the License.  You may obtain a copy of the License at
9
 *
10
 *   http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing,
13
 * software distributed under the License is distributed on an
14
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 * KIND, either express or implied.  See the License for the
16
 * specific language governing permissions and limitations
17
 * under the License.
18
 */
19

20
package org.commonwl.view.workflow;
21

22
import io.hypersistence.utils.hibernate.type.json.JsonType;
23
import jakarta.persistence.EntityManager;
24
import jakarta.persistence.PersistenceContext;
25
import jakarta.persistence.PersistenceContextType;
26
import org.commonwl.view.git.GitDetails;
27
import org.hibernate.query.Query;
28

29
public class WorkflowRepositoryImpl implements WorkflowRepositoryCustom {
1✔
30

31
  private static final String QUERY_FIND_BY_RETRIEVED_FROM =
32
      "SELECT w.* FROM workflow w WHERE w.retrieved_from = :retrievedFrom";
33

34
  @PersistenceContext(type = PersistenceContextType.EXTENDED)
35
  EntityManager entityManager;
36

37
  @Override
38
  public Workflow findByRetrievedFrom(GitDetails retrievedFrom) {
NEW
39
    final Query<?> query =
×
40
        entityManager
NEW
41
            .createNativeQuery(QUERY_FIND_BY_RETRIEVED_FROM, Workflow.class)
×
NEW
42
            .unwrap(Query.class);
×
43

NEW
44
    if (query == null) {
×
NEW
45
      return null;
×
46
    }
47

NEW
48
    query.setParameter("retrievedFrom", retrievedFrom, new JsonType(GitDetails.class));
×
NEW
49
    return (Workflow) query.uniqueResult();
×
50
  }
51
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc