Package org.jpox.store.mapped

Examples of org.jpox.store.mapped.FetchStatement


                    sb.append(' ').append(mainAlias);
                }
            }
            else
            {
                FetchStatement subQuery = mainTable.getStoreManager().getFetchStatement(mainTable);
                Iterator i = columns.iterator();
                while (i.hasNext())
                {
                    subQuery.select((DatastoreField)i.next());
                }

                // Assumed to not want any locking in this statement
                sb.append('(').append(subQuery.toString(false)).append(") ").append(mainAlias);
            }

            sqlText = sb.toString();
        }
View Full Code Here


            DatastoreContainerObject datastoreContainer,
            DatastoreMapping mapping,
            byte[] bytes)
    {
        // Generate "SELECT {blobColumn} FROM TABLE WHERE ID=? FOR UPDATE" statement
        FetchStatement fetchStmt = new RDBMSFetchStatement(datastoreContainer);
        fetchStmt.select(mapping.getDatastoreField());
        JavaTypeMapping idMapping = datastoreContainer.getIDMapping();
        for (int i = 0; i < idMapping.getNumberOfDatastoreFields(); i++)
        {
            fetchStmt.andCondition(fetchStmt.referenceDatastoreField(idMapping.getDataStoreMapping(i).getDatastoreField()) + " = ?");
        }
        String textStmt = fetchStmt.toString(true);

        if (sm.getPcObjectType() != StateManager.PC)
        {
            // This mapping is embedded, so navigate back to the real owner since that is the "id" in the table
            StateManager[] embeddedOwners = sm.getEmbeddedOwners();
View Full Code Here

            DatastoreContainerObject datastoreContainer,
            DatastoreMapping mapping,
            String value)
    {
        // Generate "SELECT {clobColumn} FROM TABLE WHERE ID=? FOR UPDATE" statement
        FetchStatement fetchStmt = new RDBMSFetchStatement(datastoreContainer);
        fetchStmt.select(mapping.getDatastoreField());
        JavaTypeMapping idMapping = datastoreContainer.getIDMapping();
        for (int i = 0; i < idMapping.getNumberOfDatastoreFields(); i++)
        {
            fetchStmt.andCondition(fetchStmt.referenceDatastoreField(idMapping.getDataStoreMapping(i).getDatastoreField()) + " = ?");
        }
        String textStmt = fetchStmt.toString(true);

        if (sm.getPcObjectType() != StateManager.PC)
        {
            // This mapping is embedded, so navigate back to the real owner since that is the "id" in the table
            StateManager[] embeddedOwners = sm.getEmbeddedOwners();
View Full Code Here

    public LocateRequest(DatastoreClass table)
    {
        super(table);

        mappingStatementIndex = new MappingStatementIndex();
        FetchStatement fetchStmt = new RDBMSFetchStatement(table);
        FetchMappingConsumer consumer = new FetchMappingConsumer(fetchStmt);
        fetchStmt.select("1");
        table.provideDatastoreIdMappings(consumer);
        table.providePrimaryKeyMappings(consumer);

        locateStmt = fetchStmt.toString();
        pkFieldNumbers = consumer.getPrimaryKeyFieldNumbers();
    }
View Full Code Here

TOP

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

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.