Package org.jboss.as.cmp.jdbc.metadata

Examples of org.jboss.as.cmp.jdbc.metadata.JDBCQlQueryMetaData


public final class JDBCEJBQLQuery extends JDBCAbstractQueryCommand {

    public JDBCEJBQLQuery(JDBCStoreManager manager, JDBCQueryMetaData q) {
        super(manager, q);

        JDBCQlQueryMetaData metadata = (JDBCQlQueryMetaData) q;
        if (getLog().isDebugEnabled()) {
            getLog().debug("EJB-QL: " + metadata.getEjbQl());
        }

        QLCompiler compiler = JDBCQueryManager.getInstance(metadata.getQLCompilerClass(), manager.getCatalog());

        try {
            compiler.compileEJBQL(
                    metadata.getEjbQl(),
                    metadata.getMethod().getReturnType(),
                    metadata.getMethod().getParameterTypes(),
                    metadata);
        } catch (Throwable t) {
            log.error(t.getMessage(), t);
            throw new RuntimeException("Error compiling EJB-QL statement for EJB '" +
                    manager.getComponent().getComponentName() + "': " + metadata.getEjbQl(), t);
        }

        setSQL(compiler.getSQL());

        // set select object
        if (compiler.isSelectEntity()) {
            JDBCEntityBridge selectEntity = (JDBCEntityBridge) compiler.getSelectEntity();

            // set the select entity
            setSelectEntity(selectEntity);

            // set the preload fields
            JDBCReadAheadMetaData readahead = metadata.getReadAhead();
            if (readahead.isOnFind()) {
                setEagerLoadGroup(readahead.getEagerLoadGroup());
                setOnFindCMRList(compiler.getLeftJoinCMRList());

                // exclude non-searchable columns if distinct is used
View Full Code Here


public final class JDBCEJBQLQuery extends JDBCAbstractQueryCommand {

    public JDBCEJBQLQuery(JDBCStoreManager manager, JDBCQueryMetaData q) {
        super(manager, q);

        JDBCQlQueryMetaData metadata = (JDBCQlQueryMetaData) q;
        if (getLog().isDebugEnabled()) {
            getLog().debug("EJB-QL: " + metadata.getEjbQl());
        }

        QLCompiler compiler = JDBCQueryManager.getInstance(metadata.getQLCompilerClass(), manager.getCatalog());

        try {
            compiler.compileEJBQL(
                    metadata.getEjbQl(),
                    metadata.getMethod().getReturnType(),
                    metadata.getMethod().getParameterTypes(),
                    metadata);
        } catch (Throwable t) {
            throw CmpMessages.MESSAGES.errorCompilingEjbQl(manager.getComponent().getComponentName(), metadata.getEjbQl(), t);
        }

        setSQL(compiler.getSQL());

        // set select object
        if (compiler.isSelectEntity()) {
            JDBCEntityBridge selectEntity = (JDBCEntityBridge) compiler.getSelectEntity();

            // set the select entity
            setSelectEntity(selectEntity);

            // set the preload fields
            JDBCReadAheadMetaData readahead = metadata.getReadAhead();
            if (readahead.isOnFind()) {
                setEagerLoadGroup(readahead.getEagerLoadGroup());
                setOnFindCMRList(compiler.getLeftJoinCMRList());

                // exclude non-searchable columns if distinct is used
View Full Code Here

TOP

Related Classes of org.jboss.as.cmp.jdbc.metadata.JDBCQlQueryMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.