Examples of ProcedureDescriptor


Examples of org.apache.ojb.broker.metadata.ProcedureDescriptor

    {
        SqlForClass sfc = getSqlForClass(cld);
        SqlStatement sql = sfc.getDeleteSql();
        if(sql == null)
        {
            ProcedureDescriptor pd = cld.getDeleteProcedure();

            if(pd == null)
            {
                sql = new SqlDeleteByPkStatement(cld, logger);
            }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.ProcedureDescriptor

        SqlStatement sql;
        SqlForClass sfc = getSqlForClass(cld);
        sql = sfc.getInsertSql();
        if(sql == null)
        {
            ProcedureDescriptor pd = cld.getInsertProcedure();

            if(pd == null)
            {
                sql = new SqlInsertStatement(cld, logger);
            }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.ProcedureDescriptor

    {
        SqlForClass sfc = getSqlForClass(cld);
        SqlStatement result = sfc.getUpdateSql();
        if(result == null)
        {
            ProcedureDescriptor pd = cld.getUpdateProcedure();

            if(pd == null)
            {
                result = new SqlUpdateStatement(cld, logger);
            }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.ProcedureDescriptor

     */
    public String getPreparedDeleteStatement(ClassDescriptor cld)
    {
        SqlStatement sql;
        String result;
        ProcedureDescriptor pd = cld.getDeleteProcedure();

        if (pd == null)
        {
            sql = new SqlDeleteByPkStatement(cld, logger);
        }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.ProcedureDescriptor

     */
    public String getPreparedInsertStatement(ClassDescriptor cld)
    {
        SqlStatement sql;
        String result;
        ProcedureDescriptor pd = cld.getInsertProcedure();

        if (pd == null)
        {
            sql = new SqlInsertStatement(cld, logger);
        }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.ProcedureDescriptor

     */
    public String getPreparedUpdateStatement(ClassDescriptor cld)
    {
        SqlStatement sql;
        String result;
        ProcedureDescriptor pd = cld.getUpdateProcedure();

        if (pd == null)
        {
            sql = new SqlUpdateStatement(cld, logger);
        }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.ProcedureDescriptor

     */
    public String getPreparedDeleteStatement(ClassDescriptor cld)
    {
        SqlStatement sql;
        String result;
        ProcedureDescriptor pd = cld.getDeleteProcedure();

        if (pd == null)
        {
            sql = new SqlDeleteByPkStatement(cld, logger);
        }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.ProcedureDescriptor

     */
    public String getPreparedInsertStatement(ClassDescriptor cld)
    {
        SqlStatement sql;
        String result;
        ProcedureDescriptor pd = cld.getInsertProcedure();

        if (pd == null)
        {
            sql = new SqlInsertStatement(cld, logger);
        }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.ProcedureDescriptor

     */
    public String getPreparedUpdateStatement(ClassDescriptor cld)
    {
        SqlStatement sql;
        String result;
        ProcedureDescriptor pd = cld.getUpdateProcedure();

        if (pd == null)
        {
            sql = new SqlUpdateStatement(cld, logger);
        }
View Full Code Here

Examples of org.voltdb.compiler.VoltCompiler.ProcedureDescriptor

                            "Cannot load class for procedure: %s",
                            className), cause);
                }
            }

            ProcedureDescriptor descriptor = m_compiler.new ProcedureDescriptor(
                    new ArrayList<String>(), Language.JAVA, null, clazz);

            // Add roles if specified.
            if (statementMatcher.group(1) != null) {
                for (String roleName : StringUtils.split(statementMatcher.group(1), ',')) {
                    // Don't put the same role in the list more than once.
                    String roleNameFixed = roleName.trim().toLowerCase();
                    if (!descriptor.m_authGroups.contains(roleNameFixed)) {
                        descriptor.m_authGroups.add(roleNameFixed);
                    }
                }
            }

            // track the defined procedure
            m_tracker.add(descriptor);

            return true;
        }

        // matches if it is CREATE PROCEDURE <proc-name> [ALLOW <role> ...] AS <select-or-dml-statement>
        statementMatcher = procedureSingleStatementPattern.matcher(statement);
        if (statementMatcher.matches()) {
            String clazz = checkIdentifierStart(statementMatcher.group(1), statement);
            String sqlStatement = statementMatcher.group(3) + ";";

            ProcedureDescriptor descriptor = m_compiler.new ProcedureDescriptor(
                    new ArrayList<String>(), clazz, sqlStatement, null, null, false, null, null, null);

            // Add roles if specified.
            if (statementMatcher.group(2) != null) {
                for (String roleName : StringUtils.split(statementMatcher.group(2), ',')) {
                    descriptor.m_authGroups.add(roleName.trim().toLowerCase());
                }
            }

            m_tracker.add(descriptor);

            return true;
        }

        // matches  if it is CREATE PROCEDURE <proc-name> [ALLOW <role> ...] AS
        // ### <code-block> ### LANGUAGE <language-name>
        statementMatcher = procedureWithScriptPattern.matcher(statement);
        if (statementMatcher.matches()) {

            String className = checkIdentifierStart(statementMatcher.group(1), statement);
            String codeBlock = statementMatcher.group(3);
            Language language = Language.valueOf(statementMatcher.group(4).toUpperCase());


            Class<?> scriptClass = null;

            if (language == Language.GROOVY) {
                try {
                    scriptClass = GroovyCodeBlockCompiler.instance().parseCodeBlock(codeBlock, className);
                } catch (CodeBlockCompilerException ex) {
                    throw m_compiler.new VoltCompilerException(String.format(
                            "Procedure \"%s\" code block has syntax errors:\n%s",
                            className, ex.getMessage()));
                } catch (Exception ex) {
                    throw m_compiler.new VoltCompilerException(ex);
                }
            } else {
                throw m_compiler.new VoltCompilerException(String.format(
                        "Language \"%s\" is not a supported", language.name()));
            }

            ProcedureDescriptor descriptor = m_compiler.new ProcedureDescriptor(
                    new ArrayList<String>(), language, codeBlock, scriptClass);

            // Add roles if specified.
            if (statementMatcher.group(2) != null) {
                for (String roleName : StringUtils.split(statementMatcher.group(2), ',')) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.