Package org.jpox.store.mapped

Examples of org.jpox.store.mapped.DatastoreField


                        DatastoreMapping datastoreMapping = embFmdMapping.getDataStoreMapping(j);
                        this.addDataStoreMapping(datastoreMapping);
                        if (fmd.isPrimaryKey())
                        {
                            // Overall embedded field should be part of PK, so make all datastore fields part of it
                            DatastoreField datastoreFld = datastoreMapping.getDatastoreField();
                            if (datastoreFld != null)
                            {
                                datastoreFld.setAsPrimaryKey();
                            }
                        }
                    }
                }
            }
View Full Code Here


        if (fmd.getElementMetaData() != null && fmd.getElementMetaData().getColumnMetaData() != null &&
            fmd.getElementMetaData().getColumnMetaData().length > 0)
        {
            colmd = fmd.getElementMetaData().getColumnMetaData()[0];
        }
        DatastoreField col = mmgr.createDatastoreField(this, getType(), colmd);
        mmgr.createDatastoreMapping(this, fmd, 0, datastoreContainer.getStoreManager(), col);
    }
View Full Code Here

     * This creates the column in the table.
     */
    protected void prepareDatastoreMapping()
    {
        MappingManager mmgr = datastoreContainer.getStoreManager().getMappingManager();
        DatastoreField col = mmgr.createDatastoreField(this, getJavaTypeForDatastoreMapping(0), 0);
        mmgr.createDatastoreMapping(this, fmd, 0, datastoreContainer.getStoreManager(), col);
    }
View Full Code Here

            // Column name defined
            ColumnMetaData colmd = dismd.getColumnMetaData();
            id = idFactory.newDatastoreFieldIdentifier(colmd.getName());
        }

        DatastoreField column = datastoreContainer.addDatastoreField(getType(), id, this, dismd.getColumnMetaData());
        datastoreContainer.getStoreManager().getMappingManager().createDatastoreMapping(delegate, datastoreContainer.getStoreManager(),
            column, getType());
    }
View Full Code Here

     * @param typeName Java type of the field to add the column for.
     */
    protected void addDatastoreField(String typeName)
    {
        MappingManager mgr = dba.getMappingManager();
        DatastoreField column = mgr.createDatastoreField(this, typeName, getNumberOfDatastoreFields());
        mgr.createDatastoreMapping(this, datastoreContainer.getStoreManager(), column, typeName);
    }
View Full Code Here

        {
            // Column name defined
            colmd = versionColumnMetaData[0];
            id = idFactory.newDatastoreFieldIdentifier(colmd.getName());
        }
        DatastoreField column = datastoreContainer.addDatastoreField(getType(), id, this, colmd);
        datastoreContainer.getStoreManager().getMappingManager().createDatastoreMapping(delegate, datastoreContainer.getStoreManager(),
            column, getType());
    }
View Full Code Here

        if (fmd.getValueMetaData() != null && fmd.getValueMetaData().getColumnMetaData() != null &&
            fmd.getValueMetaData().getColumnMetaData().length > 0)
        {
            colmd = fmd.getValueMetaData().getColumnMetaData()[0];
        }
        DatastoreField col = mmgr.createDatastoreField(this,getType(), colmd);
        mmgr.createDatastoreMapping(this, fmd, 0, datastoreContainer.getStoreManager(), col);
    }
View Full Code Here

        if (fmd.getKeyMetaData() != null && fmd.getKeyMetaData().getColumnMetaData() != null &&
            fmd.getKeyMetaData().getColumnMetaData().length > 0)
        {
            colmd = fmd.getKeyMetaData().getColumnMetaData()[0];
        }
        DatastoreField col = mmgr.createDatastoreField(this, getType(), colmd);
        mmgr.createDatastoreMapping(this, fmd, 0, datastoreContainer.getStoreManager(), col);
    }
View Full Code Here

                        refDatastoreMapping.getDatastoreField().getIdentifier(), toString())).setFatal();
                }

                // Create a Datastore field to equate to the referenced classes datastore field
                MappingManager mmgr = datastoreContainer.getStoreManager().getMappingManager();
                DatastoreField col = mmgr.createDatastoreField(fmd, datastoreContainer, mapping,
                    colmd, refDatastoreMapping.getDatastoreField(), clr);

                // Add its datastore mapping
                DatastoreMapping datastoreMapping = mmgr.createDatastoreMapping(mapping, storeMgr, col,
                    refDatastoreMapping.getJavaTypeMapping().getJavaTypeForDatastoreMapping(i));
View Full Code Here

            // Loop through each id column in the reference table and add the same here
            // applying the required names from the columnContainer
            for (int j=0; j<mapping.getNumberOfDatastoreFields(); j++)
            {
                JavaTypeMapping m = masterMapping;
                DatastoreField refColumn = mapping.getDataStoreMapping(j).getDatastoreField();
                if (mapping instanceof PersistenceCapableMapping)
                {
                    m = dba.getMapping(clr.classForName(refColumn.getMapping().getType()), storeMgr);
                    ((PersistenceCapableMapping)masterMapping).addJavaTypeMapping(m);
                }

                ColumnMetaData userdefinedColumn = null;
                if (userdefinedCols != null)
                {
                    for (int k=0;k<userdefinedCols.length;k++)
                    {
                        if (refColumn.getIdentifier().toString().equals(userdefinedCols[k].getTarget()))
                        {
                            userdefinedColumn = userdefinedCols[k];
                            break;
                        }
                    }
                    if (userdefinedColumn == null && nextUserdefinedCol < userdefinedCols.length)
                    {
                        userdefinedColumn = userdefinedCols[nextUserdefinedCol++];
                    }
                }

                // Add this application identity column
                DatastoreField idColumn = null;
                if (userdefinedColumn != null)
                {
                    // User has provided a name for this column
                    // Currently we only use the column namings from the users definition but we could easily
                    // take more of their details.
                    idColumn = addDatastoreField(refColumn.getStoredJavaType(),
                        storeMgr.getIdentifierFactory().newIdentifier(IdentifierFactory.COLUMN, userdefinedColumn.getName()),
                        m, refColumn.getMetaData());
                }
                else
                {
                    // No name provided so take same as superclass
                    idColumn = addDatastoreField(refColumn.getStoredJavaType(), refColumn.getIdentifier(),
                        m, refColumn.getMetaData());
                }
                if (mapping != null && mapping.getDataStoreMapping(j).getDatastoreField().getMetaData() != null)
                {
                    refColumn.copyConfigurationTo(idColumn);
                }
                idColumn.setAsPrimaryKey();

                // Set the column type based on the field.getType()
                getStoreManager().getMappingManager().createDatastoreMapping(m, storeMgr, idColumn,
                    refColumn.getMapping().getType());
            }
View Full Code Here

TOP

Related Classes of org.jpox.store.mapped.DatastoreField

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.