-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbee9c8
commit e8d0c6a
Showing
6 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...ain/java/com/kevinguanchedarias/owgejava/entity/dialect/OwgeMysqlFunctionContributor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.kevinguanchedarias.owgejava.entity.dialect; | ||
|
||
import org.hibernate.boot.model.FunctionContributions; | ||
import org.hibernate.boot.model.FunctionContributor; | ||
import org.hibernate.dialect.function.StandardSQLFunction; | ||
import org.hibernate.type.StandardBasicTypes; | ||
|
||
public class OwgeMysqlFunctionContributor implements FunctionContributor { | ||
|
||
@Override | ||
public void contributeFunctions(FunctionContributions functionContributions) { | ||
functionContributions.getFunctionRegistry() | ||
.register("TIME_TO_SEC", new StandardSQLFunction("TIME_TO_SEC", StandardBasicTypes.DOUBLE)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ public interface MissionReportRepository extends JpaRepository<MissionReport, Lo | |
* @author Kevin Guanche Darias <[email protected]> | ||
* @since 0.9.0 | ||
*/ | ||
@Query("UPDATE MissionReport rp SET rp.userReadDate = CURRENT_DATE WHERE rp.user.id = :userId AND rp.id IN :reportsIds") | ||
@Query("UPDATE MissionReport rp SET rp.userReadDate = CURRENT_TIMESTAMP WHERE rp.user.id = :userId AND rp.id IN :reportsIds") | ||
@Modifying | ||
void markAsReadIfUserIsOwner(List<Long> reportsIds, Integer userId); | ||
|
||
|
1 change: 1 addition & 0 deletions
1
business/src/main/resources/META-INF/services/org.hibernate.boot.model.FunctionContributor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
com.kevinguanchedarias.owgejava.entity.dialect.OwgeMysqlFunctionContributor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters