Package org.jpox.store.rdbms

Examples of org.jpox.store.rdbms.Column


    throws SQLException
    {
        Iterator i = columnsByName.values().iterator();
        while (i.hasNext())
        {
            Column col = (Column) i.next();
            if (col.isPrimaryKey())
            {
                ColumnInfo ci = storeMgr.getColumnInfoForColumnName(this, conn, col.getIdentifier());
                if (ci != null)
                {
                    col.initializeColumnInfoFromDatastore(ci);
                }
            }
        }
    }
View Full Code Here


        Iterator i = storeMgr.getColumnInfoForTable(this, conn).iterator();
        while (i.hasNext())
        {
            ColumnInfo ci = (ColumnInfo) i.next();
            DatastoreIdentifier colName = storeMgr.getIdentifierFactory().newIdentifier(IdentifierFactory.COLUMN, ci.getColumnName());
            Column col = (Column) columns.get(colName);
            if (col != null)
            {
                col.initializeColumnInfoFromDatastore(ci);
            }
        }
    }
View Full Code Here

        Set colsInFKs = new HashSet();
        ArrayList foreignKeys = new ArrayList();
        Iterator i = columns.iterator();
        while (i.hasNext())
        {
            Column col = (Column) i.next();
            if (!colsInFKs.contains(col))
            {
                try
                {
                    DatastoreClass referencedTable = storeMgr.getDatastoreClass(col.getStoredJavaType(), clr);
                    if (referencedTable != null)
                    {
                        for (int j = 0; j < col.getMapping().getNumberOfDatastoreFields(); j++)
                        {
                            colsInFKs.add(col.getMapping().getDataStoreMapping(j).getDatastoreField());
                        }
                        ForeignKey fk = new ForeignKey(col.getMapping(), dba, referencedTable, true);
                        foreignKeys.add(fk);
                    }
                }
                catch (NoTableManagedException e)
                {
View Full Code Here

                    primaryKeysByName.put(pkName, pk);
                }

                int keySeq = rs.getInt(5) - 1;
                DatastoreIdentifier colName = idFactory.newIdentifier(IdentifierFactory.COLUMN, rs.getString(4));
                Column col = (Column) columnsByName.get(colName);

                if (col == null)
                {
                    throw new UnexpectedColumnException(this.toString(), colName.getIdentifier(), this.getSchemaName(), this.getCatalogName());
                }
View Full Code Here

                      }
     
                      // Set the column
                      int colSeq = rsIndexes.getShort(8) - 1;
                      DatastoreIdentifier colName = idFactory.newIdentifier(IdentifierFactory.COLUMN, rsIndexes.getString(9));
                      Column col = (Column) columnsByName.get(colName);
     
                      if (col != null)
                      {
                          can.setDatastoreField(colSeq, col);
                      }
View Full Code Here

                    }
   
                    // Set the column
                    int colSeq = rsIndexes.getShort(8) - 1;
                    DatastoreIdentifier colName = idFactory.newIdentifier(IdentifierFactory.COLUMN, rsIndexes.getString(9));
                    Column col = (Column) columnsByName.get(colName);
   
                    if (col != null)
                    {
                        idx.setColumn(colSeq, col);
                    }
View Full Code Here

                            // Apply this set of ColumnMetaData to the existing mapping
                            int colnum = 0;
                            IdentifierFactory idFactory = getStoreManager().getIdentifierFactory();
                            for (int i=0;i<fieldMapping.getNumberOfDatastoreFields();i++)
                            {
                                Column col = (Column)fieldMapping.getDataStoreMapping(i).getDatastoreField();
                                col.setIdentifier(idFactory.newDatastoreFieldIdentifier(colmds[colnum].getName()));
                                col.setMetaData(colmds[colnum]);

                                colnum++;
                                if (colnum == colmds.length)
                                {
                                    // Reached end of specified metadata
View Full Code Here

                {
                    colmd.setLength(getStoreManager().getOMFContext().getPersistenceConfiguration().getIntProperty("org.jpox.rdbms.stringDefaultLength"));
                }
                IdentifierFactory idFactory = getStoreManager().getIdentifierFactory();
                DatastoreIdentifier colIdentifier = idFactory.newIdentifier(IdentifierFactory.COLUMN, colmd.getName());
                Column col = (Column)addDatastoreField(null, colIdentifier, null, colmd);
                TypeInfo typeInfo = dba.getTypeInfo(JDBCUtils.getJDBCTypeForName(colmd.getJdbcType()));
                col.setTypeInfo(typeInfo);

                if (unmappedColumns == null)
                {
                    unmappedColumns = new HashSet();
                }

                if (JPOXLogger.DATASTORE.isDebugEnabled())
                {
                    JPOXLogger.DATASTORE.debug(LOCALISER.msg("057011",
                        col.toString(), colmd.getJdbcType()));
                }
                unmappedColumns.add(col);
            }
        }
    }
View Full Code Here

        {
            return true;
        }
        for (int i=0; i<columns.size(); i++)
        {
            Column col = (Column) columns.get(i);
            if (col.isPrimaryKey() && col.isAutoIncrement())
            {
                return true;
            }
        }
        return false;
View Full Code Here

        if (colmds != null && colmds.length > 0)
        {
            for (int i=0;i<colmds.length;i++)
            {
                DatastoreIdentifier colName = storeMgr.getIdentifierFactory().newDatastoreFieldIdentifier(colmds[i].getName());
                Column col = (Column)columnsByName.get(colName);
                if (col == null)
                {
                    JPOXLogger.DATASTORE.warn(LOCALISER.msg("058001",
                        toString(), index.getName(), colmds[i].getName()));
                    break;
View Full Code Here

TOP

Related Classes of org.jpox.store.rdbms.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.