Add videos field to speaker#118
Conversation
Co-authored-by: AlexLaskin <ale.laskintues19@gmail.com> Co-authored-by: MagiMarinova <magi.marinowax@gmail.com>
Co-authored-by: AlexLaskin <ale.laskintues19@gmail.com> Co-authored-by: MagiMarinova <magi.marinowax@gmail.com>
|
|
||
| public Speaker saveSpeaker(Speaker speaker){ | ||
| if(speaker.getVideos() != null) | ||
| speaker.setVideos(videoSanitizerService. |
| import org.springframework.stereotype.Service; | ||
|
|
||
| @Service | ||
| public class VideoSanitizerService { |
There was a problem hiding this comment.
This looks like Util method for me. Also it doesn't work with a Video actually, it is more like working with a String name.
There was a problem hiding this comment.
Fixed: Not a service anymore, but a class StringSanitizer
| @Lob | ||
| private byte[] picture; | ||
|
|
||
| private String videos; |
There was a problem hiding this comment.
I'm wondering why did you prefer to have them as comma separated values, instead of a List coming from a 1 to many relation?
There was a problem hiding this comment.
- We choose a String field as the forms when working with speaker would become too complicated
- The admin panel for add/edit a speaker would be inconvenient
There was a problem hiding this comment.
@I-Mircheva can you make videos to be "videoLink" and to be just one URL mapped with
@column(length = 500)
private String videoLink;
for example so we dont need a migrate sql.
| @@ -0,0 +1 @@ | |||
| ALTER TABLE USER ADD COLUMN VIDEOS VARCHAR(255); No newline at end of file | |||
There was a problem hiding this comment.
Actually, sometimes URLs are huge and with the comma separated approach 255 might not b enough in some cases
There was a problem hiding this comment.
@I-Mircheva why do we need this SQL ? The schema should be updated automatically anyway.
Co-authored-by: AlexLaskin ale.laskintues19@gmail.com Co-authored-by: MagiMarinova magi.marinowax@gmail.com
|
Will merge it after jprime 2019 and before the new CFP. |
Co-authored-by: AlexLaskin ale.laskintues19@gmail.com
Co-authored-by: MagiMarinova magi.marinowax@gmail.com