Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Samuel Dudík
PA165 Winery Management System
Commits
32bd6ccb
Commit
32bd6ccb
authored
Apr 24, 2022
by
xkorenk
Browse files
Fixed HarvestEntityMapper
parent
4bf9d7cf
Pipeline
#132016
failed with stages
in 54 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
winery/service/src/main/java/cz/muni/fi/pa165/winery/services/mappers/wine/HarvestEntityMapper.java
View file @
32bd6ccb
package
cz.muni.fi.pa165.winery.services.mappers.wine
;
import
cz.muni.fi.pa165.winery.dto.wine.HarvestDto
;
import
cz.muni.fi.pa165.winery.persistence.entities.Grape
;
import
cz.muni.fi.pa165.winery.persistence.entities.Harvest
;
import
cz.muni.fi.pa165.winery.services.mappers.EntityMapperImpl
;
import
org.modelmapper.ModelMapper
;
...
...
@@ -26,4 +27,13 @@ public class HarvestEntityMapper extends EntityMapperImpl<HarvestDto, Harvest> {
.
addMappings
(
m
->
m
.
map
(
entity
->
entity
.
getGrape
().
getId
(),
HarvestDto:
:
setGrapeId
));
}
@Override
public
Harvest
mapToEntity
(
HarvestDto
record
)
{
Harvest
entity
=
super
.
mapToEntity
(
record
);
Grape
grape
=
new
Grape
();
grape
.
setId
(
record
.
getId
());
entity
.
setGrape
(
grape
);
return
entity
;
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment