Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] is it a bug

The setReadAllSQLString is only for a ReadAllQuery for ALL objects, no
selection criteria or other options.

setDefaultReadAllQueryRedirector applies to ALL ReadAllQuery's, so be
careful using it.


Rodrigue Lagoue Njinthe wrote:
> 
> hi all!
> 
> i tried to customized how eclipse link has to get all entities of a types
> by
> setting the SQLString to the queries i want here is the code in the *
> org.eclipse.persistence.config.DescriptorCustomizer.customize*
> 
> 
>         descriptorQueryManager
>                 .setReadAllSQLString("SELECT SCENARIO_ID, NAME, COUNTRY,
> LANGUAGE, TYPE, "
>                         + "DISTINGUISHED_NAME, PHONE, FAX, ADMINISTRATOR,
> ''
> AS PASSWORD, ADMIN_NAME, "
>                         + "ADMIN_PRENAME, EMAIL FROM TOPCARE.SCENARIO_VIEW
> );
> 
> but eclipselink continued to call its own queries until i made the
> following
> 
> descriptor.setDefaultReadAllQueryRedirector(new QueryRedirector() {
> 
>             /**
>              *
>              */
>             private static final long serialVersionUID =
> -1736268415325054393L;
> 
>             public Object invokeQuery(DatabaseQuery query, Record
> arguments,
>                     Session session) {
>                 query.setSQLString("SELECT SCENARIO_ID, NAME, COUNTRY,
> LANGUAGE, TYPE, "
>                                 + "DISTINGUISHED_NAME, PHONE, FAX,
> ADMINISTRATOR, '' AS PASSWORD, ADMIN_NAME, "
>                                 + "ADMIN_PRENAME, EMAIL FROM "
>                                 + "TOPCARE.SCENARIO_VIEW");
>                 query.setDoNotRedirect(true);
>                 return session.executeQuery(query);
>             }
> 
>         });
> 
> That means i defined QueryRedirector for this type and it worked.
> 
> Is it a bug?
> 
> Rodrigue
> 
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/is-it-a-bug-tp20943951p21060785.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top