Click here to Skip to main content
15,889,858 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to spring boot, working on a project, and recently an experienced developer just told me that when creating an entity table, that has a field that should deal with dates the best approach is to use long, something like this:

   private Long deliveryDate;

The thing is that I have never seen anything being done like this before, I do not understand how this should exactly work, and I couldn't find an answer anywhere I searched for it, so do you think that some of you can help me?


What I have tried:

I looked on the Internet, but I found nothing
Posted
Updated 21-Dec-21 2:47am

1 solution

It is usually best to use the proper Date or DateTime type. Check the documentation for the h2 database at Data Types[^]. But if the experienced guy insists that you use a long type then ask him to explain why.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900