Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit 57da450

Browse files
committed
[BI-1909] suggested changes
1 parent 0f9ec46 commit 57da450

File tree

3 files changed

+6
-30
lines changed

3 files changed

+6
-30
lines changed

src/main/java/org/brapi/test/BrAPITestServer/service/pheno/ObservationUnitService.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,11 @@
5757
import io.swagger.model.pheno.ObservationVariable;
5858
import io.swagger.model.pheno.ObservationVariableSearchRequest;
5959

60-
import javax.persistence.EntityManager;
61-
import javax.persistence.TypedQuery;
62-
6360
@Service
6461
public class ObservationUnitService {
6562

6663
private static final Logger log = LoggerFactory.getLogger(ObservationUnitService.class);
6764
private final ObservationUnitRepository observationUnitRepository;
68-
69-
private final EntityManager entityManager;
70-
7165
private final GermplasmService germplasmService;
7266
private final CrossService crossService;
7367
private final ObservationService observationService;
@@ -81,9 +75,8 @@ public class ObservationUnitService {
8175
public ObservationUnitService(ObservationUnitRepository observationUnitRepository, StudyService studyService,
8276
TrialService trialService, ProgramService programService, ObservationService observationService,
8377
GermplasmService germplasmService, SeedLotService seedLotService, CrossService crossService,
84-
ObservationVariableService observationVariableService, EntityManager entityManager) {
78+
ObservationVariableService observationVariableService) {
8579
this.observationUnitRepository = observationUnitRepository;
86-
this.entityManager = entityManager;
8780

8881
this.studyService = studyService;
8982
this.trialService = trialService;

src/main/java/org/brapi/test/BrAPITestServer/service/pheno/ObservationVariableService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ public List<ObservationVariable> findObservationVariables(ObservationVariableSea
141141
.appendList(request.getTraitDbIds(), "trait.id")
142142
.appendEnumList(request.getDataTypes(), "scale.dataType");
143143

144-
log.debug("Starting variable search: " + new Date());
144+
log.debug("Starting variable search");
145145
Page<ObservationVariableEntity> page = observationVariableRepository.findAllBySearch(searchQuery, pageReq);
146-
log.debug("Search variable complete: " + new Date());
146+
log.debug("Variable search complete");
147147
if(!page.isEmpty()) {
148148
observationVariableRepository.fetchXrefs(page, ObservationVariableEntity.class);
149149
observationVariableRepository.fetchAdditionalInfo(page, ObservationVariableEntity.class);
@@ -157,9 +157,9 @@ public List<ObservationVariable> findObservationVariables(ObservationVariableSea
157157
fetchTraitAdditionalInfo(page);
158158
}
159159

160-
log.debug(new Date() + ": converting "+page.getSize()+" entities");
160+
log.debug("converting "+page.getSize()+" entities");
161161
List<ObservationVariable> observationVariables = page.map(this::convertFromEntity).getContent();
162-
log.debug(new Date() + ": done converting entities");
162+
log.debug("done converting entities");
163163
PagingUtility.calculateMetaData(metadata, page);
164164
return observationVariables;
165165
}
@@ -320,7 +320,7 @@ public ObservationVariableEntity getObservationVariableEntity(String observation
320320
}
321321

322322
private ObservationVariable convertFromEntity(ObservationVariableEntity entity) {
323-
log.trace(new Date() + ": converting variable: " + entity.getId());
323+
log.trace("converting variable: " + entity.getId());
324324
ObservationVariable var = new ObservationVariable();
325325
convertFromBaseEntity(entity, var);
326326
var.setObservationVariableName(entity.getName());

src/main/resources/logback.xml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
<!--
2-
~ See the NOTICE file distributed with this work for additional information
3-
~ regarding copyright ownership.
4-
~
5-
~ Licensed under the Apache License, Version 2.0 (the "License");
6-
~ you may not use this file except in compliance with the License.
7-
~ You may obtain a copy of the License at
8-
~
9-
~ http://www.apache.org/licenses/LICENSE-2.0
10-
~
11-
~ Unless required by applicable law or agreed to in writing, software
12-
~ distributed under the License is distributed on an "AS IS" BASIS,
13-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
~ See the License for the specific language governing permissions and
15-
~ limitations under the License.
16-
-->
17-
181
<configuration>
192

203
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">

0 commit comments

Comments
 (0)