Package org.datanucleus.store.rdbms.table

Examples of org.datanucleus.store.rdbms.table.Column


                        stmtMappingDefinition.getFields()[fmd.getAbsoluteFieldNumber()] = sei;

                        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();
                            }
View Full Code Here


            JavaTypeMapping idMapping = table.getIdMapping();
            if (idMapping != null)
            {
                for (int i=0;i<idMapping.getNumberOfDatastoreMappings();i++)
                {
                    Column col = (Column)idMapping.getDatastoreMapping(i).getDatastoreField();
                    if (col.isIdentity())
                    {
                        columnName = col.getIdentifier().toString();
                        break;
                    }
                }
            }
            String autoIncStmt =
View Full Code Here

                    // create the expressions index (columns index)
                    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();
                        }

                        // Either we are a field in a secondary table.
                        // Or we are a subclass table.
                        // Or we are not datastore attributed.
                        if (table instanceof SecondaryTable || !table.isBaseDatastoreClass() ||
                            (!table.getStoreManager().isStrategyDatastoreAttributed(fmd.getValueStrategy(), false) && !c.isIdentity()))
                        {
                            if (!columnExists)
                            {
                                if (columnNames.length() > 0)
                                {
                                    columnNames.append(',');
                                    columnValues.append(',');
                                }
                                columnNames.append(columnId);
                                columnValues.append(((RDBMSMapping)m.getDatastoreMapping(j)).getInsertionInputParameter());
                            }

                            if (((RDBMSMapping)m.getDatastoreMapping(j)).insertValuesOnInsert())
                            {
                                // only add fields to be replaced by the real values only if the param value has ?
                                Integer abs_field_num = Integer.valueOf(fmd.getAbsoluteFieldNumber());
                                if (fmd.isPrimaryKey())
                                {
                                    if (!pkFields.contains(abs_field_num))
                                    {
                                        pkFields.add(abs_field_num);
                                    }
                                }
                                else if (!insertFields.contains(abs_field_num))
                                {
                                    insertFields.add(abs_field_num);
                                }

                                if (columnExists)
                                {
                                    parametersIndex[j] = ((Integer)assignedColumns.get(c.getIdentifier().toString())).intValue();
                                }
                                else
                                {
                                    parametersIndex[j] = paramIndex++;
                                }
                            }

                            if (!columnExists)
                            {
                                assignedColumns.put(c.getIdentifier().toString(), Integer.valueOf(fmd.getAbsoluteFieldNumber()));
                            }
                        }
                        else
                        {
                            hasIdentityColumn = true;
View Full Code Here

            if (columnNames.length() > 0)
            {
                columnNames.append(',');
                columnValues.append(',');
            }
            Column col = (Column)fld;
            columnNames.append(fld.getIdentifier());

            ColumnMetaData colmd = col.getColumnMetaData();
            String value = colmd.getInsertValue();
            if (value != null && value.equalsIgnoreCase("#NULL"))
            {
                value = null;
            }
View Full Code Here

TOP

Related Classes of org.datanucleus.store.rdbms.table.Column

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.