Package org.datanucleus.store.mapped

Examples of org.datanucleus.store.mapped.StatementMappingIndex.addParameterOccurrence()


                {
                    where.append(" AND " + m.getDatastoreMapping(0).getDatastoreField().getIdentifier() +
                        "=" + inputParam);

                    StatementMappingIndex versStmtIdx = new StatementMappingIndex(m);
                    versStmtIdx.addParameterOccurrence(new int[]{paramIndex++});
                    stmtMappingDefinition.setVersion2(versStmtIdx);
                }
                else
                {
                    String condition = m.getDatastoreMapping(0).getDatastoreField().getIdentifier() + "=" + inputParam;
View Full Code Here


                        columnAssignments.append(", ");
                    }
                    columnAssignments.append(condition);

                    StatementMappingIndex versStmtIdx = new StatementMappingIndex(m);
                    versStmtIdx.addParameterOccurrence(new int[]{paramIndex++});
                    stmtMappingDefinition.setVersion(versStmtIdx);
                }
            }
            else if (mappingType == MappingConsumer.MAPPING_TYPE_DATASTORE_ID)
            {
View Full Code Here

            {
                // Surrogate datastore-id column
                where.append(((DatastoreField)key.getColumns().get(0)).getIdentifier() + "=?");

                StatementMappingIndex datastoreIdIdx = new StatementMappingIndex(m);
                datastoreIdIdx.addParameterOccurrence(new int[]{paramIndex++});
                stmtMappingDefinition.setDatastoreId(datastoreIdIdx);
            }
        }

        /**
 
View Full Code Here

            if (datastoreIdx == null)
            {
                datastoreIdx = new StatementMappingIndex(datastoreIdMapping);
                mappingDefinition.addMappingForMember(StatementClassMapping.MEMBER_DATASTORE_ID, datastoreIdx);
            }
            datastoreIdx.addParameterOccurrence(new int[] {inputParamNum});
        }
        else if (table.getIdentityType() == IdentityType.APPLICATION)
        {
            // Application identity value(s) for input
            int[] pkNums = cmd.getPKMemberPositions();
View Full Code Here

                int[] inputParams = new int[pkMapping.getNumberOfDatastoreMappings()];
                for (int j=0;j<pkMapping.getNumberOfDatastoreMappings();j++)
                {
                    inputParams[j] = inputParamNum++;
                }
                pkIdx.addParameterOccurrence(inputParams);
            }
        }

        // Generate the unlocked and locked JDBC statements
        statementUnlocked = sqlStatement.getSelectStatement().toSQL();
View Full Code Here

                if (fmd.isPrimaryKey())
                {
                    Integer abs_field_num = Integer.valueOf(fmd.getAbsoluteFieldNumber());
                    int parametersIndex[] = new int[m.getNumberOfDatastoreMappings()];
                    StatementMappingIndex sei = new StatementMappingIndex(m);
                    sei.addParameterOccurrence(parametersIndex);

                    mappingStatementIndex.getPrimaryKeys()[fmd.getAbsoluteFieldNumber()] = sei;
                    for (int j=0; j<parametersIndex.length; j++)
                    {
                        if (where.length() > 0)
View Full Code Here

                    {
                        // Must be version field since nothing else should come through here
                        int parametersIndex[] = new int[m.getNumberOfDatastoreMappings()];
                        parametersIndex[0] = paramIndex++;
                        StatementMappingIndex sei = new StatementMappingIndex(m);
                        sei.addParameterOccurrence(parametersIndex);
                        mappingStatementIndex.setVersion2(sei);
                        String inputParam = ((RDBMSMapping)m.getDatastoreMapping(0)).getUpdateInputParameter();
                        String condition = " AND " + m.getDatastoreMapping(0).getDatastoreField().getIdentifier() + "=" + inputParam;
                        where.append(condition);
                    }
View Full Code Here

                where.append(m.getDatastoreMapping(0).getDatastoreField().getIdentifier().toString());
                where.append("=");
                where.append(((RDBMSMapping)m.getDatastoreMapping(0)).getUpdateInputParameter());

                int[] param = { paramIndex++ };
                datastoreMappingIdx.addParameterOccurrence(param);
            }
            else if (mappingType == MappingConsumer.MAPPING_TYPE_VERSION)
            {
                if (whereClauseConsumption)
                {
View Full Code Here

                if (whereClauseConsumption)
                {
                    StatementMappingIndex versStmtIdx = new StatementMappingIndex(m);
                    mappingStatementIndex.setVersion2(versStmtIdx);
                    int[] param = { paramIndex++ };
                    versStmtIdx.addParameterOccurrence(param);
                    String inputParam = ((RDBMSMapping)m.getDatastoreMapping(0)).getUpdateInputParameter();
                    String condition = " AND " + m.getDatastoreMapping(0).getDatastoreField().getIdentifier() + "=" + inputParam;
                    where.append(condition);
                }
            }
View Full Code Here

            if (datastoreIdx == null)
            {
                datastoreIdx = new StatementMappingIndex(datastoreIdMapping);
                mappingDefinition.addMappingForMember(StatementClassMapping.MEMBER_DATASTORE_ID, datastoreIdx);
            }
            datastoreIdx.addParameterOccurrence(new int[] {inputParamNum});
        }
        else if (cmd.getIdentityType() == IdentityType.APPLICATION)
        {
            // Application identity value(s) for input
            int[] pkNums = cmd.getPKMemberPositions();
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.