Package org.jpox.store.mapped.expression

Examples of org.jpox.store.mapped.expression.JoinExpression


            String alias = p.parseName();

            // Return as part of ClassExpression joining candidate class to this collection field
            expr = new ClassExpression(qs, candidateClass);
            expr.as(candidateAlias);
            JoinExpression joinExpr = new JoinExpression(qs, name, false, false);
            joinExpr.as(alias);
            expr.join(joinExpr);

            // Update with any subsequent JOIN expressions
            compileFromJoinExpressions(expr);
        }
View Full Code Here


                // And the alias we know this joined field by
                p.parseStringIgnoreCase("AS"); // Optional
                String alias = p.parseName();

                JoinExpression joinExpr = new JoinExpression(qs, name, leftJoin, fetch);
                joinExpr.as(alias);

                clsExpr.join(joinExpr);
            }
            else
            {
View Full Code Here

        if (joinExprs != null)
        {
            for (int i=0;i<joinExprs.length;i++)
            {
                JoinExpression joinExpr = joinExprs[i];
                String joinFieldName = joinExpr.getFieldName();

                boolean complete = false;
                int joinNum = 0;
                while (!complete)
                {
                    // Split the join field name into components so we have "alias.field"
                    // If the join field name is of the form "a.b.c.d" then this will mean multiple joins
                    int sepPos1 = joinFieldName.indexOf('.');
                    if (sepPos1 < 0)
                    {
                        // No join since no "alias.field" form
                        break;
                    }
                    int sepPos2 = joinFieldName.indexOf('.', sepPos1+1);
                    if (sepPos2 < 0)
                    {
                        complete = true;
                        sepPos2 = joinFieldName.length();
                    }

                    String leftAlias = joinFieldName.substring(0, sepPos1);
                    String fieldName = joinFieldName.substring(sepPos1+1, sepPos2);
                    String rightAlias = null;
                    if (complete)
                    {
                        rightAlias = joinExpr.getAlias();
                    }
                    else
                    {
                        rightAlias = "TMP" + joinNum;
                    }

                    if (joinExpr.getFieldName().equals(leftAlias + '.' + fieldName))
                    {
                        // No internal joins needed, so just process the compiled JoinExpression
                        processJoinExpression(joinExpr);
                    }
                    else
                    {
                        // Internal joins needed, so construct and process this component
                        JoinExpression expr = new JoinExpression(qs, leftAlias + '.' + fieldName,
                            joinExpr.isLeftJoin(), joinExpr.isFetch());
                        if (rightAlias != null)
                        {
                            expr.as(rightAlias);
                        }
                        processJoinExpression(expr);

                        if (!complete)
                        {
View Full Code Here

TOP

Related Classes of org.jpox.store.mapped.expression.JoinExpression

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.