Skip to content

Commit

Permalink
HHH-16130 Add javadoc for dateTrunc
Browse files Browse the repository at this point in the history
  • Loading branch information
mbladel authored and beikov committed Feb 28, 2023
1 parent 5da8102 commit cf42b13
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -998,6 +998,18 @@ <Y extends Comparable<? super Y>> JpaPredicate between(
@Incubating
JpaFunction<Float> second(Expression<? extends TemporalAccessor> datetime);

/**
* Truncates a date, time or datetime expression to the given {@link TemporalUnit}.
* Supported units are: {@code YEAR}, {@code MONTH}, {@code DAY}, {@code HOUR}, {@code MINUTE}, {@code SECOND}.
* <p>
* Truncating translates to obtaining a value of the same type in which all temporal units smaller than {@code field} have been pruned.
* For hours, minutes and second this means setting them to {@code 00}. For months and days, this means setting them to {@code 01}.
*
* @param datetime the date, time or datetime expression to be truncated
* @param temporalUnit the temporal unit for truncation
*
* @return the truncated value
*/
@Incubating
<T extends TemporalAccessor> JpaFunction<T> truncate(Expression<T> datetime, TemporalUnit temporalUnit);

Expand Down

0 comments on commit cf42b13

Please sign in to comment.