Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

ORM and Dates? You probably want timestamp

DZone's Guide to

ORM and Dates? You probably want timestamp

· Java Zone ·
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

Data types for dates and times are slightly different across databases which often makes life difficult for us developers. ColdFusion ORM makes this pretty simple:

  • For a date with time use ormtype="timestamp"
  • Just a date use ormtype="date"

There are no other options!

Full example with the property tag:

property name="aFullDateWithTime" ormtype="timestamp";
property name="justADate" ormtype="date";

 

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}