You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by Thomas Andraschko <an...@gmail.com> on 2014/05/26 16:22:06 UTC
@Query naming conflict with javax.persistence.Query. Rename?
Hi,
i currently start to use the Data Module and one thing isn't really nice.
If you have an abstract Repository, you likely have an import of
"javax.persistence.Query" and maybe @Query.
What do you think about renaming @Query to resolve the naming conflict?
Regards,
Thomas
Re: @Query naming conflict with javax.persistence.Query. Rename?
Posted by Romain Manni-Bucau <rm...@gmail.com>.
You will not get it using TypedQuery ;).
@Query is the smoother default IMO
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-05-26 16:22 GMT+02:00 Thomas Andraschko <an...@gmail.com>:
> Hi,
>
> i currently start to use the Data Module and one thing isn't really nice.
>
> If you have an abstract Repository, you likely have an import of
> "javax.persistence.Query" and maybe @Query.
>
> What do you think about renaming @Query to resolve the naming conflict?
>
> Regards,
> Thomas
>
Re: @Query naming conflict with javax.persistence.Query. Rename?
Posted by Romain Manni-Bucau <rm...@gmail.com>.
well, honestly more abstract repo are promoted less they seem useful.
interfaces are where the real added value is then some interceptors (for
audit for instance) are nice but no more. Abstract repo are technically
interesting but for app code they seem just a debt, no? What would be the
real use case then?
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-05-26 16:56 GMT+02:00 Thomas Hug <th...@gmail.com>:
> Thought about this too as it pops up also in some impl classes, but
> couldn't think of a better concise name :-)
> What about adding something like a
>
> TypedQuery<E> createTypedQuery(...) // eventually rename createQuery
> for the CriteriaQuery result?
>
> to AbstractEntityRepository? Might make the workaround more obvious.
>
>
>
> On Mon, May 26, 2014 at 4:38 PM, Romain Manni-Bucau
> <rm...@gmail.com>wrote:
>
> > You will not get it using TypedQuery ;).
> >
> > @Query is the smoother default IMO
> >
> >
> >
> > Romain Manni-Bucau
> > Twitter: @rmannibucau
> > Blog: http://rmannibucau.wordpress.com/
> > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > Github: https://github.com/rmannibucau
> >
> >
> > 2014-05-26 16:22 GMT+02:00 Thomas Andraschko <
> andraschko.thomas@gmail.com
> > >:
> >
> > > Hi,
> > >
> > > i currently start to use the Data Module and one thing isn't really
> nice.
> > >
> > > If you have an abstract Repository, you likely have an import of
> > > "javax.persistence.Query" and maybe @Query.
> > >
> > > What do you think about renaming @Query to resolve the naming conflict?
> > >
> > > Regards,
> > > Thomas
> > >
> >
>
Re: @Query naming conflict with javax.persistence.Query. Rename?
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Ok, so I'd go for TypedQuery.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-05-26 17:38 GMT+02:00 Thomas Hug <th...@gmail.com>:
> At least for me, it's typically when the findByExample doesn't work anymore
> (date range searches etc).
>
>
> On Mon, May 26, 2014 at 5:21 PM, Romain Manni-Bucau
> <rm...@gmail.com>wrote:
>
> > well, honestly more abstract repo are promoted less they seem useful.
> > interfaces are where the real added value is then some interceptors (for
> > audit for instance) are nice but no more. Abstract repo are technically
> > interesting but for app code they seem just a debt, no? What would be the
> > real use case then?
> >
> >
> >
> > Romain Manni-Bucau
> > Twitter: @rmannibucau
> > Blog: http://rmannibucau.wordpress.com/
> > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > Github: https://github.com/rmannibucau
> >
> >
> > 2014-05-26 16:56 GMT+02:00 Thomas Hug <th...@gmail.com>:
> >
> > > Thought about this too as it pops up also in some impl classes, but
> > > couldn't think of a better concise name :-)
> > > What about adding something like a
> > >
> > > TypedQuery<E> createTypedQuery(...) // eventually rename
> createQuery
> > > for the CriteriaQuery result?
> > >
> > > to AbstractEntityRepository? Might make the workaround more obvious.
> > >
> > >
> > >
> > > On Mon, May 26, 2014 at 4:38 PM, Romain Manni-Bucau
> > > <rm...@gmail.com>wrote:
> > >
> > > > You will not get it using TypedQuery ;).
> > > >
> > > > @Query is the smoother default IMO
> > > >
> > > >
> > > >
> > > > Romain Manni-Bucau
> > > > Twitter: @rmannibucau
> > > > Blog: http://rmannibucau.wordpress.com/
> > > > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > > > Github: https://github.com/rmannibucau
> > > >
> > > >
> > > > 2014-05-26 16:22 GMT+02:00 Thomas Andraschko <
> > > andraschko.thomas@gmail.com
> > > > >:
> > > >
> > > > > Hi,
> > > > >
> > > > > i currently start to use the Data Module and one thing isn't really
> > > nice.
> > > > >
> > > > > If you have an abstract Repository, you likely have an import of
> > > > > "javax.persistence.Query" and maybe @Query.
> > > > >
> > > > > What do you think about renaming @Query to resolve the naming
> > conflict?
> > > > >
> > > > > Regards,
> > > > > Thomas
> > > > >
> > > >
> > >
> >
>
Re: @Query naming conflict with javax.persistence.Query. Rename?
Posted by Thomas Hug <th...@gmail.com>.
At least for me, it's typically when the findByExample doesn't work anymore
(date range searches etc).
On Mon, May 26, 2014 at 5:21 PM, Romain Manni-Bucau
<rm...@gmail.com>wrote:
> well, honestly more abstract repo are promoted less they seem useful.
> interfaces are where the real added value is then some interceptors (for
> audit for instance) are nice but no more. Abstract repo are technically
> interesting but for app code they seem just a debt, no? What would be the
> real use case then?
>
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-05-26 16:56 GMT+02:00 Thomas Hug <th...@gmail.com>:
>
> > Thought about this too as it pops up also in some impl classes, but
> > couldn't think of a better concise name :-)
> > What about adding something like a
> >
> > TypedQuery<E> createTypedQuery(...) // eventually rename createQuery
> > for the CriteriaQuery result?
> >
> > to AbstractEntityRepository? Might make the workaround more obvious.
> >
> >
> >
> > On Mon, May 26, 2014 at 4:38 PM, Romain Manni-Bucau
> > <rm...@gmail.com>wrote:
> >
> > > You will not get it using TypedQuery ;).
> > >
> > > @Query is the smoother default IMO
> > >
> > >
> > >
> > > Romain Manni-Bucau
> > > Twitter: @rmannibucau
> > > Blog: http://rmannibucau.wordpress.com/
> > > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > > Github: https://github.com/rmannibucau
> > >
> > >
> > > 2014-05-26 16:22 GMT+02:00 Thomas Andraschko <
> > andraschko.thomas@gmail.com
> > > >:
> > >
> > > > Hi,
> > > >
> > > > i currently start to use the Data Module and one thing isn't really
> > nice.
> > > >
> > > > If you have an abstract Repository, you likely have an import of
> > > > "javax.persistence.Query" and maybe @Query.
> > > >
> > > > What do you think about renaming @Query to resolve the naming
> conflict?
> > > >
> > > > Regards,
> > > > Thomas
> > > >
> > >
> >
>
Re: @Query naming conflict with javax.persistence.Query. Rename?
Posted by Thomas Hug <th...@gmail.com>.
Thought about this too as it pops up also in some impl classes, but
couldn't think of a better concise name :-)
What about adding something like a
TypedQuery<E> createTypedQuery(...) // eventually rename createQuery
for the CriteriaQuery result?
to AbstractEntityRepository? Might make the workaround more obvious.
On Mon, May 26, 2014 at 4:38 PM, Romain Manni-Bucau
<rm...@gmail.com>wrote:
> You will not get it using TypedQuery ;).
>
> @Query is the smoother default IMO
>
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-05-26 16:22 GMT+02:00 Thomas Andraschko <andraschko.thomas@gmail.com
> >:
>
> > Hi,
> >
> > i currently start to use the Data Module and one thing isn't really nice.
> >
> > If you have an abstract Repository, you likely have an import of
> > "javax.persistence.Query" and maybe @Query.
> >
> > What do you think about renaming @Query to resolve the naming conflict?
> >
> > Regards,
> > Thomas
> >
>