Request JPG application date

Suppose I have an object that represents TASK. The task has a deadline.

How to create a request to get all the tasks that must be completed today?

Some working code, for example

"select t from task t, where dueDate =: today"

will be helpful.

Thanks in advance.

+4
source share
2 answers

You assume that @Temporal is supported by the Google GAE / J plugin. This is not true despite being reported more than a year ago by http://code.google.com/p/datanucleus-appengine/issues/detail?id=20&colspec=ID%20Stars%20Type%20Status%20Priority%20FoundIn% 20TargetRelease% 20Owner% 20Summary

+2
source

Assuming your dueDate is Date annotated as follows:

 @Temporal(TemporalType.DATE) private Date dueDate; 

Then you can execute the following query in JPQL:

 select t from Task where t.dueDate = current_date 
0
source

Source: https://habr.com/ru/post/1310551/


All Articles