Examples of newLiteral()


Examples of org.datanucleus.store.rdbms.sql.expression.SQLExpressionFactory.newLiteral()

        ClassLoaderResolver clr = storeMgr.getNucleusContext().getClassLoaderResolver(null);
        SQLStatement sqlStatement = new SQLStatement(storeMgr, table, null, null);
        mappingDefinition = new StatementClassMapping();
        SQLExpressionFactory exprFactory = storeMgr.getSQLExpressionFactory();
        JavaTypeMapping m = storeMgr.getMappingManager().getMapping(Integer.class);
        sqlStatement.select(exprFactory.newLiteral(sqlStatement, m, 1), null);

        // Add WHERE clause restricting to the identity of an object
        AbstractClassMetaData cmd = storeMgr.getMetaDataManager().getMetaDataForClass(table.getType(), clr);

        int inputParamNum = 1;
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

            {
                Object current = it.next();
                if (null != current)
                {
                    JavaTypeMapping m = dba.getMapping(current.getClass(), qs.getStoreManager(), qs.getClassLoaderResolver());
                    ScalarExpression expr = m.newLiteral(qs, current);

                    // Append the SQLExpression (should be a literal) for the
                    // current element.
                    st.append(hadPrev ? "," : "");
                    st.append(expr);
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

        BooleanExpression elementsExpr = null;
        for (Iterator it = userCandidates.iterator(); it.hasNext();)
        {
            Object candidateValue = it.next();
            ScalarExpression expr = m.newScalarExpression(stmt, stmt.getMainTableExpression());
            BooleanExpression keyExpr = expr.eq(m.newLiteral(stmt, candidateValue));
            if (elementsExpr == null)
            {
                elementsExpr = keyExpr;
            }
            else
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

            ClassLoaderResolver clr = qs.getClassLoaderResolver();
            if (value instanceof OID)
            {
                // Object is an OID
                JavaTypeMapping m = dba.getMapping(((OID)value).getKeyValue().getClass(), storeMgr, clr);
                ScalarExpression oidExpr =  m.newLiteral(qs,((OID)value).getKeyValue());
                bExpr = expr.expressionList.getExpression(0).eq(oidExpr);
            }
            else
            {
                ApiAdapter api = qs.getStoreManager().getApiAdapter();
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

                    // if there is no metadata, we either have an SingleFieldIdentity, application identity, or any object
                    if (storeMgr.getApiAdapter().isSingleFieldIdentityClass(value.getClass().getName()))
                    {
                        // Object is SingleFieldIdentity
                        JavaTypeMapping m = dba.getMapping(api.getTargetClassForSingleFieldIdentity(value), storeMgr, clr);
                        ScalarExpression oidExpr =  m.newLiteral(qs, api.getTargetKeyForSingleFieldIdentity(value));
                        bExpr = expr.expressionList.getExpression(0).eq(oidExpr);
                    }
                    else
                    {
                        String pcClassName = storeMgr.getClassNameForObjectID(value, clr, null);
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

                                /*bExpr = expr.eq(new NullLiteral(qs));*/
                            }
                            else
                            {
                                JavaTypeMapping m = dba.getMapping(objectId.getKeyValue().getClass(), storeMgr, clr);
                                ScalarExpression oidExpr = m.newLiteral(qs, objectId.getKeyValue());
                                bExpr = source.eq(oidExpr);
                            }
                        }
                    }
                }
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

            else
            {
                //if a simple value, we simply apply the equals
                ScalarExpression source = expr.getExpressionList().getExpression(index.index);
                JavaTypeMapping mapping = storeMgr.getDatastoreAdapter().getMapping(value.getClass(), storeMgr, clr);
                ScalarExpression target = mapping.newLiteral(qs, value);
                if( bExpr == null )
                {
                    bExpr = source.eq(target);
                }
                else
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

            }
            else
            {
                mapping = dba.getMapping(fieldValue.getClass(), qs.getStoreManager(), qs.getClassLoaderResolver());               
            }
            return mapping.newLiteral(qs,fieldValue);
        }
        catch (SecurityException e)
        {
            throw new JPOXUserException("Cannot access field: "+subfieldName,e);
        }
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

            {
                // Just get a default mapping for type
                m = qs.getStoreManager().getDatastoreAdapter().getMapping(value.getClass(),
                    qs.getStoreManager(), qs.getClassLoaderResolver());
            }
            return m.newLiteral(qs, value);
        }
        catch (IllegalAccessException iae)
        {
            // Will not happen since we already checked for it
        }
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

            {
                Object current = it.next();
                if (current != null)
                {
                    JavaTypeMapping m = dba.getMapping(current.getClass(), qs.getStoreManager(), qs.getClassLoaderResolver());
                    ScalarExpression expr = m.newLiteral(qs,current);

                    // Append the SQLExpression (should be a literal) for the
                    // current element.
                    st.append(hadPrev ? "," : "");
                    st.append(expr);
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.