Another option is to use DataNucleus' type-safe queries. I just recently
started playing around with these; the isisaddons' todoapp shows an example
[1]
The main thing you need to ensure is that your IDE has annotation
processing enabled. IntelliJ does this automatically, so does Eclipse I
think, so it should probably "just work". It requires:
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jdo</artifactId>
</dependency>
to be in your classpath of the dom module (this is where the annotation
processor implementation is, I believe).
Cheers
Dan
[1]
https://github.com/isisaddons/isis-app-todoapp/blob/master/dom/src/main/java/todoapp/dom/module/todoitem/ToDoItemRepositoryImplUsingTypesafeQueries.java#L37
On 15 May 2015 at 05:28, Chuangyu <[email protected]> wrote:
> Oh ,I find the IsisJdoSupportService.
>
> 2015-05-15 12:17 GMT+08:00 Chuangyu <[email protected]>:
>
> > Hi,
> >
> > I tried to find query aggregate values use JDOQL ,but
> > DomainObjectContainer seems not support that?
> >
> > all methods returns <T> or List<T>, but cannot return a Integer.
> >
> > for example :
> >
> > @javax.jdo.annotations.Query(
> > name="countAll",language = "JDOQL",
> > value = "SELECT count(this)"
> > + "FROM dom.SimpleObject"
> > )
> >
> >
> > Thanks
> >
> > James
> >
>