Why do you need to do it in the query? Why not just handle it in the java code.
for example:
From RandomThing
Where randomTime is not null and
randomTime >= :currentTimestamp and
randomTime <= :maxTimestamp
And then just set the parameters.
More Related Contents:
- How do you create a Distinct query in HQL
- how to return Map with HQL
- Date operations in HQL
- New object with HQL
- How to simulate NVL in HQL
- Mapping many-to-many association table with extra column(s)
- What is the difference between JOIN and JOIN FETCH when using JPA and Hibernate
- JPA and Hibernate – Criteria vs. JPQL or HQL
- What is the difference between DAO and Repository patterns?
- How to query data for Primefaces dataTable using lazy loading and pagination
- Hibernate Search: How to use wildcards correctly?
- Struggling to understand EntityManager proper use
- java.lang.ClassNotFoundException: org.hibernate.HibernateException
- Hibernate problem – “Use of @OneToMany or @ManyToMany targeting an unmapped class”
- How to use the Java 8 LocalDateTime with JPA and Hibernate
- Hibernate throws org.hibernate.AnnotationException: No identifier specified for entity: com..domain.idea.MAE_MFEView
- Using JPA entities in JSF. Which is the best strategy to prevent LazyInitializationException?
- Hibernate field naming issue with Spring Boot (naming strategy)
- Hibernate: How specify custom sequence generator class name using annotations?
- Deleted object would be re-saved by cascade (remove deleted object from associations)
- what is the right path to refer a jar file in jpa persistence.xml in a web app?
- JPA CriteriaBuilder – How to use “IN” comparison operator
- Setting properties programmatically in Hibernate
- When to Use EntityManager.clear()?
- HQL left join of un-related entities
- Hibernate unidirectional one to many association – why is a join table better?
- What is the right way to use spring MVC with Hibernate in DAO, service layer architecture
- hibernate – get id after save object
- How to write a like query in HQL
- UnsupportedOperationException: The application must supply JDBC connections