[hibernate-dev] 6.0 - HQL literals

Steve Ebersole steve at hibernate.org
Wed Jan 8 07:37:06 EST 2020


On Wed, Jan 8, 2020 at 4:21 AM Yoann Rodiere <yoann at hibernate.org> wrote:

> > This does nothing with Type.  The way the grammar is defined it
> literally understands each piece of the temporal.  So given, e.g.,
> {2020-01-01}, we know that 2020 is the year, etc.  This is the benefit of
> defining it syntactically.
>
> I trust you can build a temporal correctly from a string. I'm more
> concerned about passing that information to the JDBC driver through a
> parameter, or even directly to the database through an SQL literal. Last
> time I checked you had to use java.sql types to pass temporal parameters to
> JDBC drivers, so you will have to convert the java.time value to a
> java.sql.Timestamp or similar eventually. And *that* is much more tricky
> that I, at least, originally thought.
>


Not sure why we keep coming back to how the literal will be used in JDBC.
Again, this topic is about HQL parsing.

Yes, handling temporal values at the JDBC/SQL level can be very tricky.
That's true however whether that temporal value is an HQL literal or an
attribute value.

And its just a completely different topic overall.

>


More information about the hibernate-dev mailing list