Skip to content

Commit

Permalink
fix mapping between entity props and document props
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaffter committed Oct 12, 2024
1 parent 81cbd04 commit 74355c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

@Document(collection = "dataversion")
public class DataVersionEntity {

@Id
public String id;

@Field("data_file")
public String dataFile;

@Field("data_version")
public String dataVersion;

@Field("team_images_id")
public String teamImagesId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

public interface DataVersionRepository extends MongoRepository<DataVersionEntity, String> {
@Query("{}")
DataVersionEntity get();
DataVersionEntity find();
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public DataVersionService(DataVersionRepository dataVersionRepository) {

@Transactional(readOnly = true)
public DataversionDto getDataVersion() {
DataVersionEntity entity = this.dataVersionRepository.get();
DataVersionEntity entity = this.dataVersionRepository.find();

return DataversionDto.builder()
.dataFile(entity.dataFile)
Expand Down

0 comments on commit 74355c0

Please sign in to comment.