Package org.apache.ojb.broker.util

Examples of org.apache.ojb.broker.util.BrokerHelper


        this.pbf = pbf;
        this.pbKey = key;
        /*
        be careful when changing initializing order
        */
        brokerHelper = new BrokerHelper(this);
        connectionManager = ConnectionManagerFactory.getInstance().createConnectionManager(this);
        /*
        TODO: find better solution
        MaterializationCache is a interim solution help to solve the problem of not full
        materialized object reads by concurrent threads and will be replaced when
View Full Code Here


     */
    protected Query[] buildMtoNImplementorQueries(Collection owners, Collection children)
    {
        ClassDescriptor cld = getOwnerClassDescriptor();
        Class topLevelClass = getBroker().getTopLevelClass(cld.getClassOfObject());
        BrokerHelper helper = getBroker().serviceBrokerHelper();
        Collection queries = new ArrayList(owners.size());
        Collection idsSubset = new HashSet(owners.size());
        Object[] fkValues;
        Object owner;
        Identity id;

        Iterator iter = owners.iterator();
        while (iter.hasNext())
        {
            owner = iter.next();
            fkValues = helper.extractValueArray(helper.getKeyValues(cld, owner));
            id = new Identity(null, topLevelClass, fkValues);
            idsSubset.add(id);
            if (idsSubset.size() == pkLimit)
            {
                queries.add(buildMtoNImplementorQuery(idsSubset));
View Full Code Here

                m_objectsTopLevelClass = targetBroker.getTopLevelClass(objectToIdentify.getClass());
                m_objectsRealClass = objectToIdentify.getClass();

                // BRJ: definitely do NOT convertToSql
                // conversion is done when binding the sql-statement
                BrokerHelper helper = targetBroker.serviceBrokerHelper();
                m_pkValues = helper.extractValueArray( helper.getKeyValues(cld, objectToIdentify, false) );
            }

            checkForPrimaryKeys();
        }
        catch (Exception e)
View Full Code Here

        this.pbf = pbf;
        this.pbKey = key;
        /*
        be careful when changing initializing order
        */
        brokerHelper = new BrokerHelper(this);
        connectionManager = ConnectionManagerFactory.getInstance().createConnectionManager(this);
        /*
        TODO: find better solution
        InternalCache is a interim solution help to solve the problem of not full
        materialized object reads by concurrent threads and will be replaced when
View Full Code Here

     */
    protected Query[] buildMtoNImplementorQueries(Collection owners, Collection children)
    {
        ClassDescriptor cld = getOwnerClassDescriptor();
        Class topLevelClass = getBroker().getTopLevelClass(cld.getClassOfObject());
        BrokerHelper helper = getBroker().serviceBrokerHelper();
        Collection queries = new ArrayList(owners.size());
        Collection idsSubset = new HashSet(owners.size());
        Object[] fkValues;
        Object owner;
        Identity id;

        Iterator iter = owners.iterator();
        while (iter.hasNext())
        {
            owner = iter.next();
            fkValues = helper.extractValueArray(helper.getKeyValues(cld, owner));
            id = new Identity(null, topLevelClass, fkValues);
            idsSubset.add(id);
            if (idsSubset.size() == pkLimit)
            {
                queries.add(buildMtoNImplementorQuery(idsSubset));
View Full Code Here

                    m_objectsTopLevelClass = targetBroker.getTopLevelClass(objectToIdentify.getClass());
                    m_objectsRealClass = objectToIdentify.getClass();

                    // BRJ: definitely do NOT convertToSql
                    // conversion is done when binding the sql-statement
                    final BrokerHelper helper = targetBroker.serviceBrokerHelper();
                    final ValueContainer[] pkValues = helper.getKeyValues(cld, objectToIdentify, false);
                    if (pkValues == null || pkValues.length == 0)
                    {
                        throw createException("Can't extract PK value fields", objectToIdentify, null);
                    }
                    m_pkValues = helper.extractValueArray(pkValues);
                }
            }

            checkForPrimaryKeys(objectToIdentify);
        }
View Full Code Here

     */
    protected Query[] buildPrefetchQueries(Collection owners, Collection children)
    {
        ClassDescriptor cld = getOwnerClassDescriptor();
        Class topLevelClass = getBroker().getTopLevelClass(cld.getClassOfObject());
        BrokerHelper helper = getBroker().serviceBrokerHelper();
        Collection queries = new ArrayList(owners.size());
        Collection idsSubset = new HashSet(owners.size());
        Object[] fkValues;
        Object owner;
        Identity id;

        Iterator iter = owners.iterator();
        while (iter.hasNext())
        {
            owner = iter.next();
            fkValues = helper.extractValueArray(helper.getKeyValues(cld, owner));
            id = new Identity(null, topLevelClass, fkValues);
            idsSubset.add(id);
            if (idsSubset.size() == pkLimit)
            {
                queries.add(buildPrefetchQuery(idsSubset));
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.util.BrokerHelper

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.