Skip to main content

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

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

Back to the top