Package org.datanucleus.store.mapped

Examples of org.datanucleus.store.mapped.DatastoreIdentifier


        }
        if (sourceTable == null)
        {
            sourceTable = primaryTable;
        }
        DatastoreIdentifier targetId = rdbmsMgr.getIdentifierFactory().newDatastoreContainerIdentifier(targetAlias);
        SQLTable targetTbl = new SQLTable(this, target, targetId, tableGrpName);
        putSQLTableInGroup(targetTbl, tableGrpName, JoinType.LEFT_OUTER_JOIN);
        join(SQLJoin.JoinType.LEFT_OUTER_JOIN, sourceTable, sourceMapping, sourceParentMapping,
            targetTbl, targetMapping, targetParentMapping, discrimValues);
View Full Code Here


        }
        if (sourceTable == null)
        {
            sourceTable = primaryTable;
        }
        DatastoreIdentifier targetId = rdbmsMgr.getIdentifierFactory().newDatastoreContainerIdentifier(targetAlias);
        SQLTable targetTbl = new SQLTable(this, target, targetId, tableGrpName);
        putSQLTableInGroup(targetTbl, tableGrpName, JoinType.RIGHT_OUTER_JOIN);

        join(JoinType.RIGHT_OUTER_JOIN, sourceTable, sourceMapping, sourceParentMapping,
            targetTbl, targetMapping, targetParentMapping, discrimValues);
View Full Code Here

        }
        if (targetAlias == null)
        {
            targetAlias = generateTableAlias(target, tableGrpName);
        }
        DatastoreIdentifier targetId = rdbmsMgr.getIdentifierFactory().newDatastoreContainerIdentifier(targetAlias);
        SQLTable targetTbl = new SQLTable(this, target, targetId, tableGrpName);
        putSQLTableInGroup(targetTbl, tableGrpName, JoinType.CROSS_JOIN);

        join(JoinType.CROSS_JOIN, primaryTable, null, null, targetTbl, null, null, null);
View Full Code Here

                        DatastoreMapping[] mappings = m.getDatastoreMappings();
                        for (int j=0;j<mappings.length;j++)
                        {
                            String alias = orderExpr + "_" + j;
                            DatastoreIdentifier aliasId =
                                rdbmsMgr.getIdentifierFactory().newDatastoreFieldIdentifier(alias);
                            SQLColumn col = new SQLColumn(orderingExpressions[i].getSQLTable(),
                                mappings[j].getDatastoreField(), aliasId);
                            String selectedName = col.toString();
                            selectItem(selectedName);
View Full Code Here

                        for (int j = 0; j < parametersIndex.length; j++)
                        {
                            // check if the column was not already assigned
                            Column c = (Column)m.getDatastoreMapping(j).getDatastoreField();
                            DatastoreIdentifier columnId = c.getIdentifier();
                            boolean columnExists = assignedColumns.containsKey(columnId.toString());
                            if (columnExists)
                            {
                                parametersIndex[j] = ((Integer)assignedColumns.get(columnId.toString())).intValue();
                            }

                            String param = ((RDBMSMapping)m.getDatastoreMapping(j)).getUpdateInputParameter();
                            if (!columnExists)
                            {
                                if (columnAssignments.length() > 0)
                                {
                                    columnAssignments.append(",");
                                }
                                columnAssignments.append(columnId).append("=").append(param);
                            }

                            if (param.indexOf("?") > -1)
                            {
                                // only add fields to be replaced by the real values only if the param value has ?
                                if (!updateFields.contains(abs_field_num))
                                {
                                    updateFields.add(abs_field_num);
                                }
                                parametersIndex[j] = paramIndex++;
                            }
                            if (!columnExists)
                            {
                                assignedColumns.put(columnId.toString(), Integer.valueOf(fmd.getAbsoluteFieldNumber()));
                            }
                        }
                    }
                }
            }
View Full Code Here

                    int parametersIndex[] = new int[m.getNumberOfDatastoreMappings()];
                    for (int j = 0; j < parametersIndex.length; j++)
                    {
                        // check if the column was not already assigned
                        Column c = (Column)m.getDatastoreMapping(j).getDatastoreField();
                        DatastoreIdentifier columnId = c.getIdentifier();
                        boolean columnExists = assignedColumns.containsKey(columnId.toString());
                        if (columnExists)
                        {
                            parametersIndex[j] = ((Integer)assignedColumns.get(c.getIdentifier().toString())).intValue();
                        }
View Full Code Here

     * @param table The table name
     * @return Its key (fully-qualified table name)
     */
    private String getTableKeyInRDBMSSchemaInfo(String catalog, String schema, String table)
    {
        DatastoreIdentifier fullyQualifiedTableName =
            storeMgr.getIdentifierFactory().newDatastoreContainerIdentifier(table);
        fullyQualifiedTableName.setCatalogName(catalog);
        fullyQualifiedTableName.setSchemaName(schema);
        return fullyQualifiedTableName.getFullyQualifiedName(true);
    }
View Full Code Here

            // Allocate any missing columns
            for (int i = colmds.length; i < mappingSideB.getNumberOfDatastoreMappings(); i++)
            {
                // Find next unallocated sideB column
                DatastoreIdentifier sideBidentifier = null;
                for (int j=0; j < sideBidentifiers.length; j++)
                {
                    if (!sideButilised[j])
                    {
                        sideBidentifier = sideBidentifiers[j];
                        sideButilised[j] = true;
                        break;
                    }
                }
                if (sideBidentifier == null)
                {
                    throw new NucleusUserException(LOCALISER.msg("020005",
                        columnsName, "" + i)).setFatal();
                }

                // Create a new ColumnMetaData since user hasn't provided enough
                ColumnMetaData colmd = new ColumnMetaData();
                if (updateContainer)
                {
                    columnContainer.addColumn(colmd);
                }
                putColumn(sideBidentifier, colmd);
            }
        }
        else
        {
            columnsName = null;
            for (int i = 0; i < mappingSideB.getNumberOfDatastoreMappings(); i++)
            {
                final DatastoreIdentifier sideBidentifier;
                sideBidentifier = mappingSideB.getDatastoreMapping(i).getDatastoreField().getIdentifier();

                // Create a new ColumnMetaData since user hasn't provided enough
                ColumnMetaData colmd = new ColumnMetaData();
                putColumn(sideBidentifier, colmd);
View Full Code Here

            // Allocate any missing columns
            for (int i = colmds.length; i < mappingSideB.getNumberOfDatastoreMappings(); i++)
            {
                // Find next unallocated sideB column
                DatastoreIdentifier sideBidentifier = null;
                for (int j=0; j < sideBidentifiers.length; j++)
                {
                    if (!sideButilised[j])
                    {
                        sideBidentifier = sideBidentifiers[j];
                        sideButilised[j] = true;
                        break;
                    }
                }
                if (sideBidentifier == null)
                {
                    throw new NucleusUserException(LOCALISER.msg("020005",
                        columnsName, "" + i)).setFatal();
                }

                // Create a new ColumnMetaData since user hasn't provided enough
                ColumnMetaData colmd = new ColumnMetaData();
                if (updateContainer)
                {
                    columnContainer.addColumn(colmd);
                }
                putColumn(sideBidentifier, colmd);
            }
        }
        else
        {
            columnsName = null;
            for (int i = 0; i < mappingSideB.getNumberOfDatastoreMappings(); i++)
            {
                final DatastoreIdentifier sideBidentifier;
                sideBidentifier = mappingSideB.getDatastoreMapping(i).getDatastoreField().getIdentifier();

                // Create a new ColumnMetaData since user hasn't provided enough
                ColumnMetaData colmd = new ColumnMetaData();
                putColumn(sideBidentifier, colmd);
View Full Code Here

        // The MetaData supports multiple columns and so we could extend this in the future
        // to use all MetaData information.
        ColumnMetaData[] versionColumnMetaData = vermd.getColumnMetaData();
        ColumnMetaData colmd;
        IdentifierFactory idFactory = datastoreContainer.getStoreManager().getIdentifierFactory();
        DatastoreIdentifier id = null;
        if (versionColumnMetaData.length == 0)
        {
            // No column name so generate a default
            id = idFactory.newVersionFieldIdentifier();
            colmd = new ColumnMetaData();
            colmd.setName(id.getIdentifierName());
            datastoreContainer.getVersionMetaData().addColumn(colmd);
        }
        else
        {
            // Column metadata defined
            colmd = versionColumnMetaData[0];
            if (colmd.getName() == null)
            {
                // No name defined so create one and set it
                id = idFactory.newVersionFieldIdentifier();
                colmd.setName(id.getIdentifierName());
            }
            else
            {
                // Name defined so just generate identifier
                id = idFactory.newDatastoreFieldIdentifier(colmd.getName());
View Full Code Here

TOP

Related Classes of org.datanucleus.store.mapped.DatastoreIdentifier

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.