Package org.datanucleus

Examples of org.datanucleus.ClassLoaderResolver.classForName()


                }

                if (el != null)
                {
                    // Get name of the element that objects of this type are stored under
                    Class cls = clr.classForName(cmd.getFullClassName());
                    String classElementName = XMLUtils.getElementNameForClass(cmd);
                    for (int i = 0; i < el.getChildNodes().getLength(); i++)
                    {
                        if (el.getChildNodes().item(i) instanceof Element)
                        {
View Full Code Here


    private Object getObjectForAbstractClass(ExecutionContext ec, final Object rs, int[] param, AbstractClassMetaData cmd)
    {
        ClassLoaderResolver clr = ec.getClassLoaderResolver();

        // Abstract class, so we need to generate an AID before proceeding
        Class objectIdClass = clr.classForName(cmd.getObjectidClass());
        Class pcClass = clr.classForName(cmd.getFullClassName());
        Object id;
        if (cmd.usesSingleFieldIdentityClass())
        {
            id = createSingleFieldIdentity(ec, rs, param, cmd, objectIdClass, pcClass);
View Full Code Here

    {
        ClassLoaderResolver clr = ec.getClassLoaderResolver();

        // Abstract class, so we need to generate an AID before proceeding
        Class objectIdClass = clr.classForName(cmd.getObjectidClass());
        Class pcClass = clr.classForName(cmd.getFullClassName());
        Object id;
        if (cmd.usesSingleFieldIdentityClass())
        {
            id = createSingleFieldIdentity(ec, rs, param, cmd, objectIdClass, pcClass);
        }
View Full Code Here

        final StatementClassMapping resultMappings = new StatementClassMapping();
        for (int i=0;i<pkFieldNumbers.length;i++)
        {
            resultMappings.addMappingForMember(pkFieldNumbers[i], statementExpressionIndex[pkFieldNumbers[i]]);
        }
        return ec.findObjectUsingAID(new Type(clr.classForName(cmd.getFullClassName())),
            new FieldValues()
            {
                // StateManager calls the fetchFields method
                public void fetchFields(ObjectProvider sm)
                {
View Full Code Here

                        }
                        evaluators.put("STATIC", eval);
                    }
                    else
                    {
                        Class elemCls = clr.classForName(elemClsName);
                        if (elemCls.isAssignableFrom(type))
                        {
                            // Evaluator is applicable to the required type
                            requiredEvaluator = eval;
                        }
View Full Code Here

            throw new NucleusUserException(LOCALISER_CORE.msg("037016", instanceofClassName));
        }

        // Extract type of member and check obvious conditions
        SQLExpressionFactory exprFactory = stmt.getSQLExpressionFactory();
        Class memberType = clr.classForName(mapping.getType());
        if (!memberType.isAssignableFrom(type) && !type.isAssignableFrom(memberType))
        {
            // Member type and instanceof type are totally incompatible, so just return false
            JavaTypeMapping m = exprFactory.getMappingForType(boolean.class, true);
            return exprFactory.newLiteral(stmt, m, true).eq(exprFactory.newLiteral(stmt, m, not));
View Full Code Here

                        // It fails when we want to do "a instanceof SUB1 || a instanceof SUB2"
                        // TODO How do we handle those cases?
                        JavaTypeMapping m = exprFactory.getMappingForType(boolean.class, true);
                        if (stmt.getNumberOfUnions() > 0)
                        {
                            Class mainCandidateCls = clr.classForName(stmt.getCandidateClassName());
                            if (type.isAssignableFrom(mainCandidateCls) == not)
                            {
                                SQLExpression unionClauseExpr = exprFactory.newLiteral(stmt, m, true).eq(
                                    exprFactory.newLiteral(stmt, m, false));
                                stmt.whereAnd((BooleanExpression)unionClauseExpr, false);
View Full Code Here

                            List<SQLStatement> unionStmts = stmt.getUnions();
                            Iterator<SQLStatement> iter = unionStmts.iterator();
                            while (iter.hasNext())
                            {
                                SQLStatement unionStmt = iter.next();
                                Class unionCandidateCls = clr.classForName(unionStmt.getCandidateClassName());
                                if (type.isAssignableFrom(unionCandidateCls) == not)
                                {
                                    SQLExpression unionClauseExpr = exprFactory.newLiteral(unionStmt, m, true).eq(
                                        exprFactory.newLiteral(unionStmt, m, false));
                                    unionStmt.whereAnd((BooleanExpression)unionClauseExpr, false);
View Full Code Here

                                exprFactory.newLiteral(stmt, m, true));
                            return (BooleanExpression)returnExpr;
                        }
                        else
                        {
                            Class mainCandidateCls = clr.classForName(stmt.getCandidateClassName());
                            if (!type.isAssignableFrom(mainCandidateCls))
                            {
                                return exprFactory.newLiteral(stmt, m, true).eq(
                                    exprFactory.newLiteral(stmt, m, not));
                            }
View Full Code Here

        HashSet exceptions = new HashSet();
        for (int i=0;i<classNames.length;i++)
        {
            try
            {
                Class cls = clr.classForName(classNames[i]);
                // Check for MetaData for this class (take precedence over annotations if they exist)
                AbstractClassMetaData cmd = classMetaDataByClass.get(classNames[i]);
                if (cmd == null)
                {
                    // No MetaData so try annotations
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.