hibernate/hibernate-orm · error · UnsupportedOperationException

'{className}' does not support 'timestampdiff()'

Error message

'{className}' does not support 'timestampdiff()'

What it means

Error "'{className}' does not support 'timestampdiff()'" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java:1799

	 */
	public boolean supportsFractionalTimestampArithmetic() {
		return true;
	}

	/**
	 * Obtain a pattern for the SQL equivalent to a
	 * {@code timestampdiff()} function call. The resulting
	 * pattern must contain ?1, ?2, and ?3 placeholders
	 * for the arguments.
	 *
	 * @param unit the first argument
	 * @param fromTemporalType true if the first argument is
	 *                      a timestamp, false if a date
	 * @param toTemporalType true if the second argument is
	 */
	@SuppressWarnings("deprecation")
	public String timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType) {
		throw new UnsupportedOperationException( "'" + getClass().getName() + "' does not support 'timestampdiff()'" );
	}

	/**
	 * Obtain a pattern for the SQL equivalent to a
	 * {@code timestampadd()} function call. The resulting
	 * pattern must contain ?1, ?2, and ?3 placeholders
	 * for the arguments.
	 *
	 * @param unit The unit to add to the temporal
	 * @param temporalType The type of the temporal
	 * @param intervalType The type of interval to add or null if it's not a native interval
	 */
	@SuppressWarnings("deprecation")
	public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType) {
		throw new UnsupportedOperationException( "'" + getClass().getName() + "' does not yet support 'timestampadd()'" );
	}

	/**

View on GitHub (pinned to fad1729dce)

Solutions

  1. Use a dialect that supports timestampdiff(), or rewrite the query with a supported function/native SQL for this database.

Example fix

Use a dialect that supports timestampdiff(), or rewrite the query with a supported function/native SQL for this database.

When it happens

Trigger: A dialect-specific function or stream operation is used that the current database dialect does not support.

Common situations: Calling timestampadd()/timestampdiff() on dialects lacking support, or LOB stream handling hitting IO failures.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/b5ea71adb9b16576. Report an issue: GitHub.