Examples of DatastoreContainerObject


Examples of org.jpox.store.mapped.DatastoreContainerObject

                // TODO Cater for more than one related field
                if (fmd.getJoinMetaData() != null || relatedMmds[0].getJoinMetaData() != null)
                {
                    // Join table relation - only allows for Collection/Array
                    // Create an expression this table to the join table on the element id, selecting the owner id
                    DatastoreContainerObject targetTable = srm.getDatastoreContainerObject(relatedMmds[0]);
                    JavaTypeMapping refMapping = null;
                    JavaTypeMapping selectMapping = null;
                    DatastoreElementContainer elementTable = (DatastoreElementContainer)targetTable;
                    refMapping = elementTable.getElementMapping();
                    selectMapping = elementTable.getOwnerMapping();
View Full Code Here

Examples of org.jpox.store.mapped.DatastoreContainerObject

     * @param col The column
     * @return The column statement text
     */
    public String referenceDatastoreField(DatastoreField col)
    {
        DatastoreContainerObject t = col.getDatastoreContainerObject();
        String alias = null;
        if (t.equals(mainTable))
        {
            alias = "THIS";
        }
        else
        {
            if (alias == null)
            {
                // Check if we have an inner join to this table
                Iterator iter = innerTableMappings.entrySet().iterator();
                while (iter.hasNext())
                {
                    Map.Entry entry = (Map.Entry)iter.next();
                    InnerJoinDefinition join = (InnerJoinDefinition)entry.getValue();
                    if (t.equals(join.getTable()))
                    {
                        alias = (String)entry.getKey();
                        break;
                    }
                }
            }
        }
        if (alias == null)
        {
            // No join present so create INNER join
            alias = "INNER" + (innerTableMappings.size()+1);
            innerTableMappings.put(alias, new InnerJoinDefinition(t, t.getIDMapping()));
        }

        return col.applySelectFunction(alias + '.' + col.getIdentifier().toString());
    }
View Full Code Here

Examples of org.jpox.store.mapped.DatastoreContainerObject

                    else if (imd.getStrategyValue() == InheritanceStrategy.SUPERCLASS_TABLE)
                    {
                        // Table mapped into table of superclass
                        // Find the superclass - should have been created first
                        AbstractClassMetaData[] managingCmds = getClassesManagingTableForClass(cmd, clr);
                        DatastoreContainerObject superTable = null;
                        if (managingCmds != null && managingCmds.length == 1)
                        {
                            RDBMSStoreData superData = (RDBMSStoreData) storeDataMgr.get(managingCmds[0].getFullClassName());
                            if (superData != null)
                            {
View Full Code Here

Examples of org.jpox.store.mapped.DatastoreContainerObject

            List result = new ArrayList();
            Set uniqueTables = new TreeSet(new Comparator()
            {
                public int compare(Object o1, Object o2)
                {
                    DatastoreContainerObject t1 = (DatastoreContainerObject) o1;
                    DatastoreContainerObject t2 = (DatastoreContainerObject) o2;
                    return StringUtils.toJVMIDString(t1).compareTo(StringUtils.toJVMIDString(t2));
                }
            });
            uniqueTables.addAll(newTables);
            result.addAll(uniqueTables);
View Full Code Here

Examples of org.jpox.store.mapped.DatastoreContainerObject

        private boolean hasDuplicateTablesFromList(List newTables)
        {
            Map map = new HashMap();
            for (int i=0; i<newTables.size(); i++)
            {
                DatastoreContainerObject t1 = (DatastoreContainerObject) newTables.get(i);
                if (map.containsKey(t1.getIdentifier().getIdentifier()))
                {
                    return true;
                }
                map.put(t1.getIdentifier().getIdentifier(), t1);
            }
            return false;
        }
View Full Code Here

Examples of org.jpox.store.mapped.DatastoreContainerObject

         * @param type The type of the join table
         */
        private DatastoreContainerObject addJoinTableForContainer(AbstractMemberMetaData fmd, ClassLoaderResolver clr, int type)
        {
            DatastoreIdentifier tableName = getTableIdentifier(fmd, clr);
            DatastoreContainerObject join = null;
            if (type == JOIN_TABLE_COLLECTION)
            {
                join = new CollectionTable(tableName, fmd, RDBMSManager.this);
            }
            else if (type == JOIN_TABLE_MAP)
View Full Code Here

Examples of org.jpox.store.mapped.DatastoreContainerObject

     * Utility to return whether this table is a view.
     * @return Whether it is for a view.
     **/
    public boolean mapsToView()
    {
        DatastoreContainerObject table = getDatastoreContainerObject();
        if (table == null)
        {
            return false;
        }
        return (table instanceof ViewImpl);
View Full Code Here

Examples of org.jpox.store.mapped.DatastoreContainerObject

                    fmd.getFullFieldName(), fmd.toString()));
            }
        }

        // Check if the join table already exists
        DatastoreContainerObject joinTable = getDatastoreContainerObject(fmd);
        if (joinTable != null)
        {
            return joinTable;
        }
View Full Code Here

Examples of org.jpox.store.mapped.DatastoreContainerObject

     */
    private CollectionStore getBackingStoreForCollection(AbstractMemberMetaData fmd, 
            ClassLoaderResolver clr, Class type)
    {
        CollectionStore store = null;
        DatastoreContainerObject datastoreTable = getDatastoreContainerObject(fmd);
        if (type==null)
        {
            // No type to base it on so create it based on the field declared type
            if (datastoreTable == null)
            {
View Full Code Here

Examples of org.jpox.store.mapped.DatastoreContainerObject

     * @return The backing store of this map in this store
     */
    private MapStore getBackingStoreForMap(AbstractMemberMetaData fmd, ClassLoaderResolver clr, Class type)
    {
        MapStore store = null;
        DatastoreContainerObject datastoreTable = getDatastoreContainerObject(fmd);
        if (datastoreTable == null)
        {
            store = new FKMapStore(fmd, this, clr);
        }
        else
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.