Examples of serviceIdentity()


Examples of org.apache.ojb.broker.PersistenceBroker.serviceIdentity()

    final PersistenceBroker pb = (PersistenceBroker) pbControl.getMock();
    MockControl idfControl = MockControl.createControl(IdentityFactory.class);
    final IdentityFactory idf = (IdentityFactory) idfControl.getMock();

    Identity identity = new Identity(String.class, Object.class, new Object[] {"id"});
    pb.serviceIdentity();
    pbControl.setReturnValue(idf, 1);
    idf.buildIdentity(String.class, "id");
    idfControl.setReturnValue(identity, 1);
    pb.getObjectByIdentity(identity);
    pbControl.setReturnValue("", 1);
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceIdentity()

            isNew = pb.serviceBrokerHelper().hasNullPKField(cld, obj);
            if(!isNew)
            {
                if(oid == null)
                {
                    oid = pb.serviceIdentity().buildIdentity(cld, obj);
                }
                final ObjectEnvelope mod = objectEnvelopeTable.getByIdentity(oid);
                if(mod != null)
                {
                    // already registered object, use current state
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceIdentity()

     * @return the resulting ObjectEnvelope
     */
    public ObjectEnvelope get(Object pKey, boolean isNew)
    {
        PersistenceBroker broker = transaction.getBroker();
        Identity oid = broker.serviceIdentity().buildIdentity(pKey);
        return get(oid, pKey, isNew);
    }

    /**
     * retrieve an objects ObjectEnvelope state from the hashtable.
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceIdentity()

            {
                Iterator it = BrokerHelper.getCollectionIterator(collOrArray);
                while(it.hasNext())
                {
                    Object colObj = ProxyHelper.getRealObject(it.next());
                    Identity oid = pb.serviceIdentity().buildIdentity(colObj);
                    ObjectEnvelope colMod = get(oid, colObj, false);
                    if(cascadeDelete)
                    {
                        colMod.setModificationState(colMod.getModificationState().markDelete());
                        cascadeDeleteFor(colMod, alreadyPrepared);
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceIdentity()

        {
            try
            {
                PersistenceBroker broker = tx.getBroker();
                // build Identity to lookup entry
                Identity oid = broker.serviceIdentity().buildIdentity(NamedEntry.class, key);
                entry = (NamedEntry) broker.getObjectByIdentity(oid);
            }
            catch(Exception e)
            {
                log.error("Can't materialize bound object for key '" + key + "'", e);
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceIdentity()

            }
        }
        NamedEntry oldEntry = localLookup(name);
        if(oldEntry == null)
        {
            Identity oid = broker.serviceIdentity().buildIdentity(NamedEntry.class, name);
            oldEntry = (NamedEntry) broker.getObjectByIdentity(oid);
        }
        if(oldEntry != null)
        {
            throw new ObjectNameNotUniqueException("The name of the specified named object already exist, name=" + name);
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceIdentity()

                 * otherwise, use default.
                 */
                broker = PersistenceBrokerFactory.defaultPersistenceBroker();
            }

            oid = broker.serviceIdentity().buildIdentity(obj);
        }
        finally
        {
            if(broker != null)
            {
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceIdentity()

// use OJB's extension for faster Identity lookup
            PerfArticle result;
            m_tx.setImplicitLocking(false);
            m_tx.begin();
            PersistenceBroker pb = m_tx.getBroker();
            result = (PerfArticle) pb.getObjectByIdentity(pb.serviceIdentity().buildIdentity(PerfArticleImpl.class, articleId));
            m_tx.commit();
            return result;
        }

        public void updateArticles(PerfArticle[] arr) throws Exception
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceIdentity()


        for (Iterator it = children.iterator(); it.hasNext(); )
        {
            relatedObject = it.next();
            childrenMap.put(pb.serviceIdentity().buildIdentity(relatedObject), relatedObject);
        }

        for (Iterator it = owners.iterator(); it.hasNext(); )
        {
            owner = it.next();
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceIdentity()

            if (isNull(fkValues))
            {
                field.set(owner, null);
                continue;
            }
            id = pb.serviceIdentity().buildIdentity(null, topLevelClass, fkValues);
            relatedObject = childrenMap.get(id);
            field.set(owner, relatedObject);
        }
    }
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.