Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support passing java.util.Date as a Field<Object> bind value #8022

Closed
lukaseder opened this issue Nov 5, 2018 · 1 comment
Closed

Support passing java.util.Date as a Field<Object> bind value #8022

lukaseder opened this issue Nov 5, 2018 · 1 comment

Comments

@lukaseder
Copy link
Member

When using plain SQL, we currently cannot use java.util.Date values as follows:

java.util.Date d = new java.util.Date(0);
Field<Object> f = field(name(TDates_TS().getName()));

Query q = create().insertInto(TDates(), TDates_ID(), f).values(1, d);
assertEquals(1, q.execute());

Of course, a more appropriate data type would be java.sql.Date or java.sql.Timestamp or any java.time data type. But for legacy reasons, users may not be able to use those data types.

In the absence of a specific data type binding or converter, we should bind java.util.Date as java.sql.Timestamp, transferring the unix timestamp between the data types.

@lukaseder lukaseder added this to the Version 3.12.0 milestone Nov 5, 2018
@lukaseder lukaseder changed the title Error when passing java.util.Date as a Field<Object> bind value Support passing java.util.Date as a Field<Object> bind value Nov 5, 2018
@lukaseder
Copy link
Member Author

Related issue: #7370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant