[hibernate-dev] 6.0 - formalized standard functions

Sanne Grinovero sanne at hibernate.org
Tue May 30 06:14:16 EDT 2017


Hi Steve,
just a curiosity; for `coalesce` and `nullif` you stated "not
technically a function, but supported as such to allow overriding".

What does it mean?

Thanks!
Sanne

On 29 May 2017 at 22:29, Steve Ebersole <steve at hibernate.org> wrote:
> Hibernate has always defined a set of functions that should always be
> available on every Dialect/database.  JPA formalized some of these, but
> Hibernate still had a superset.  So I wanted to formalize the complete set
> of supported functions.  Here is the formalized list of what Hibernate has
> always considered the "supported list":
>
>    - those defined by JPA
>    - abs
>       - avg
>       - concat
>       - count
>       - current_date
>       - current_time
>       - current_timestamp
>       - length
>       - locate
>       - lower
>       - max
>       - min
>       - mod
>       - sqrt
>       - substring
>       - sum
>       - trim
>       - upper
>    - Hibernate extensions
>    - bit_length
>       - coalesce - not technically a function, but supported as such to
>       allow overriding
>       - cast
>       - day - generally defined as `extract(day from ?1)`
>       - extract
>       - hour - generally defined as `extract(hour from ?1)`
>       - minute - generally defined as `extract(minute from ?1)`
>       - month - generally defined as `extract(month from ?1)`
>       - nullif - not technically a function, but supported as such to allow
>       overriding
>       - second - generally defined as `extract(second from ?1)`
>       - str - generally defined as `cast(?1 as CHAR )`
>       - year - generally defined as `extract(year from ?1)`
>
>
> Additions/subtractions anyone would like to discuss?
>
> One question I has was in regards to str being defined as `cast(?1 as CHAR
> )` by default - specifically using CHAR instead of VARCHAR.  Some databases
> apply padding for the size of the datatype when casting a numeric to a CHAR
> which is not an unreasonable thing to do.
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev


More information about the hibernate-dev mailing list