File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/main/java/com/cotato/itda/domain/mission Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1515@ Table (name = "mission" )
1616public class Mission extends BaseEntity {
1717
18- @ Column (name = "mission_date" , nullable = false )
18+ @ Column (name = "mission_date" , nullable = false , columnDefinition = "DATE" )
1919 private LocalDate missionDate ;
2020
2121 @ Enumerated (EnumType .STRING )
Original file line number Diff line number Diff line change 22
33import com .cotato .itda .domain .mission .entity .Mission ;
44import org .springframework .data .jpa .repository .JpaRepository ;
5+ import org .springframework .data .jpa .repository .Query ;
6+ import org .springframework .data .repository .query .Param ;
57
68import java .time .LocalDate ;
79import java .util .Optional ;
810
911public interface MissionRepository extends JpaRepository <Mission , Long > {
1012
11- Optional <Mission > findByMissionDate (LocalDate missionDate );
13+ @ Query (value = "SELECT * FROM mission WHERE mission_date = CAST(:missionDate AS DATE)" , nativeQuery = true )
14+ Optional <Mission > findByMissionDate (@ Param ("missionDate" ) LocalDate missionDate );
1215}
You can’t perform that action at this time.
0 commit comments