About Temporal

manual

Date and Time in JPQL and Criteria Queries

Shows how date and time can be used in JPQL queries. Date and time expressions may appear in JPQL queries: as date and time literals - e.g. {d '2011-12-31'} , {t '23:59:59'} . as parameters - when date and time values are assigned as arguments. ...

 
api-jpa

JPA Annotations for Fields

Reference (JavaDoc) of JPA 2 field annotations, including @Basic, @Embedded, @EmbeddedId, @Version, @Transient, @Enumerated, @MapKeyEnumerated, @Temporal and @MapKeyTemporal.... date and calendar fields: javax.persistence.Temporal javax.persistence.TemporalType ...

 
api-jpa

javax.persistence.Temporal

This annotation must be specified for persistent fields or properties of type java.util.Date and java.util.Calendar.(Annotation of JPA)

 
manual

JPA Persistable Types

Explains how JPA manages types, including entity classes, embeddable classes, primitive types, wrappers, string, date, enum, collections and maps.... Simple Java Data Types Date and Time (Temporal) Types Multi Value Types Proxy Classes ... more detail in the next paragraph. Date and Time (Temporal) Types The java.sql date and time classes represent ...

 
forum_thread

Wrong data stored in date only fileds

Hi, the following query returns records with startDate of 24/10/2015 before records with startDate of 25/10/2015: SELECT r from RecordingMetaData AS r ORDER BY r.startDate DESC, r.startTime DESC, r.channelNumber DESC If we place the same data in an SQL database and run the following query we get the records in the expected order, i.e. records with startDate of 25/10/2015 before records with startDate 24/10/2015: ... ( optional = false ) @ Temporal ( TemporalType . TIMESTAMP ) public ... ( optional = false ) @ Temporal ( TemporalType . DATE ) public Date ...

 
forum_thread

Internal exception when updating date filed (TemporalType.DATE)

Hello! ObjectDB version 2.5.3_02. I get internal exception when commiting update Date field (javax.persistence.TemporalType.DATE). ... toString ( ) ;   @ Temporal ( javax. persistence . TemporalType . TIMESTAMP ... new Date ( ) ;   @ Temporal ( javax. persistence . TemporalType . TIMESTAMP ...

 
forum_thread

Possible issue with String fields

Hi I'm brand new to objectdb and I'm trying to create an objectdb from a sample db via jdbc. The code all works and for a few thousand records but when I increase the number of records I get the following " ... ; String external_booking_ref ; @ Temporal ( javax. persistence . TemporalType . DATE ) Date start_dt ;   @ Temporal ( javax. persistence . TemporalType . DATE ) ...

 
forum_thread

Wrong data stored in time only fields

This may be related to the fix for the problem described in this thread: Wrong data stored in date only fields. The object and its date and time fields are the same as in the referenced thread. Except we are using ObjectDB 2.6.4_08, the system time zone is set to EST and both the OS and JVM are using the 2015g time zone data. ... ; import javax. persistence . Temporal ; import javax. persistence . TemporalType ; ... optional = false ) @ Temporal ( TemporalType . TIMESTAMP ) ...

 
forum_thread

Finding an object by its datetime

SearchBookingByTimeStamp() { Calendar btime = Calendar.getInstance(); btime.set(2012, 10, 11, 7, 30, 00); //This time is already inserted, trying to find it /* My Query */ TypedQuery<Booking> query = em.createQuery( "SELECT b FROM Booking b WHERE b.btime = :btime", Booking.class) .setParameter("btime", btime, TemporalType.TIMESTAMP); } @Entity public class Booking { @Temporal(TemporalType.TIMESTAMP) Calendar btime; }   ... public class Booking { @ Temporal ( TemporalType . TIMESTAMP ) Calendar btime ... Hi, I forgot the @Index beside @Temporal(TemporalType.TIMESTAMP) Calendar btime; It looks like this now ...

 
forum_thread

TemporalType injection with Calendar using JPA

I have ObjectDB  JPA  comsummed by a RESTful web service deployed on Tomcat. I am using an embedded object as a primary key, which has time fields which I have annotated with TemporalType.TIMESTAMP When I use a java.util.Date as a field on this object there is no problem. However, if I use a java.util.Calendar it encounters an exception.   Calendar is what I need.  Is there something obvious here that I am failing to see?   ... private String periodType ;   @ Temporal ( TemporalType . TIMESTAMP ) public ... = beginTime ; }   @ Temporal ( TemporalType . TIMESTAMP ) public ...