Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

How to compare Calendar Entity to current_timestamp?

Kelly Kerr

2010-08-16


Author LoginPost Reply

I have the following query:
"SELECT g FROM ParameterDefinitionFull g " +
    "WHERE g.pk.parameterName like :pk_parameterName and
g.expiryDateTime > current_timestamp"
The entity definition for g.expiryDateTime is like this:
 @Temporal(TemporalType.TIMESTAMP)
 @Column(name="EXP_TS")
 private Calendar expiryDateTime;

When I run the query I get the following error:
Attempt to compare incompatible types "class java.util.Calendar" and "class
java.util.Date"

The timestamp looks like this :
2010-06-23 17:32:03.343

Can this comparison be done? Thanks for the help!!
--
Sent from the OpenJPA Users mailing list archive at Nabble.com.
©2008 gg3721.com - Jax Systems, LLC, U.S.A.