Package org.apache.ojb.broker

Examples of org.apache.ojb.broker.Identity


     * @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);
    }
View Full Code Here


                    }
                    else
                    {
                        rt = new RuntimeObject(depObj, getTransaction());
                    }
                    Identity oid = rt.getIdentity();
                    if(!alreadyPrepared.contains(oid))
                    {
                        ObjectEnvelope depMod = getByIdentity(oid);
                        // if the object isn't registered and is a new object, register it
                        // else we have nothing to do
View Full Code Here

                {
                    Object colObj = it.next();
                    if(colObj != null)
                    {
                        RuntimeObject rt = new RuntimeObject(colObj, getTransaction());
                        Identity oid = rt.getIdentity();
                        /*
                        arminw:
                        only when the main object need insert we start with FK assignment
                        of the 1:n and m:n relations. If the main objects need update (was already persisted)
                        it should be handled by the object state detection in ObjectEnvelope
View Full Code Here

            if(getTransaction().cascadeDeleteFor(ord))
            {
                Object depObj = ord.getPersistentField().get(source.getObject());
                if(depObj != null)
                {
                    Identity oid = getTransaction().getBroker().serviceIdentity().buildIdentity(depObj);
                    // if(!isNewAssociatedObject(oid) && !alreadyPrepared.contains(oid))
                    // if the object has a new association with a different object, don't delete it
                    if(!isNewAssociatedObject(oid))
                    {
                        ObjectEnvelope depMod = get(oid, depObj, false);
View Full Code Here

            {
                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

     * Replace the current with a new generated identity object and
     * returns the old one.
     */
    public Identity refreshIdentity()
    {
        Identity oldOid = getIdentity();
        this.oid = getBroker().serviceIdentity().buildIdentity(myObj);
        return oldOid;
    }
View Full Code Here

    public void doInsert()
    {
        if(log.isDebugEnabled()) log.debug("Start INSERT action for " + getIdentity());
        performLinkEntries();
        getBroker().store(getObject(), getIdentity(), getClassDescriptor(), true, true);
        Identity oldOid = refreshIdentity();
        buffer.replaceRegisteredIdentity(getIdentity(), oldOid);
    }
View Full Code Here

   * If now writer exists, null is returned.
   */
  public LockEntry getWriter(Object obj)
  {
    PersistenceBroker broker = getBroker();
    Identity oid = new Identity(obj, broker);
   
        LockEntry result = null;
        try
        {
          result = getWriterRemote(oid);
View Full Code Here

  public Collection getReaders(Object obj)
  {
    Collection result = null;
        try
        {
            Identity oid = new Identity(obj, getBroker());
            byte selector = (byte) 'r';
            byte[] requestBarr = buildRequestArray(oid, selector);
           
            HttpURLConnection conn = getHttpUrlConnection();
           
View Full Code Here

   */
  public boolean addReader(TransactionImpl tx, Object obj)
  {
    try
    {
      LockEntry lock = new LockEntry(new Identity(obj,getBroker()).toString(),
          tx.getGUID(),
          System.currentTimeMillis(),
          LockStrategyFactory.getIsolationLevel(obj),
          LockEntry.LOCK_READ);
            addReaderRemote(lock);
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.Identity

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.