Package org.apache.ojb.broker.metadata

Examples of org.apache.ojb.broker.metadata.ClassDescriptor


      {
      query = QueryFactory.newQuery(clazz, criteria, distinct);
      }
      else
      {
      ClassDescriptor cld = MetadataManager.getInstance().getRepository().getDescriptorFor(clazz);
      for (int i = 0; i < projectionAttrs.length; i++)
      {
      projectionAttrs[i] = projectionAttrs[i].substring(projectionAttrs[i].indexOf('.') + 1);
      }
     
      ArrayList descs = cld.getAttributeDescriptorsForPath(projectionAttrs[0]);
      int pathLen = descs.size();
     
      if ((pathLen > 0) && (descs.get(pathLen - 1) instanceof ObjectReferenceDescriptor))
      {
      ObjectReferenceDescriptor ord =
View Full Code Here


        return readLock(tx, oid, obj);
    }

    public boolean readLock(TransactionImpl tx, Identity oid, Object obj)
    {
        ClassDescriptor cld = tx.getBroker().getClassDescriptor(ProxyHelper.getRealClass(obj));
        int isolationLevel = cld.getIsolationLevel();
        return ignore(isolationLevel) ? true : lm.readLock(tx.getGUID(), oid, isolationLevel);
    }
View Full Code Here

        return writeLock(tx, oid, obj);
    }

    public boolean writeLock(TransactionImpl tx, Identity oid, Object obj)
    {
        ClassDescriptor cld = tx.getBroker().getClassDescriptor(ProxyHelper.getRealClass(obj));
        int isolationLevel = cld.getIsolationLevel();
        return ignore(isolationLevel) ? true : lm.writeLock(tx.getGUID(), oid, isolationLevel);
    }
View Full Code Here

        return upgradeLock(tx, oid, obj);
    }

    public boolean upgradeLock(TransactionImpl tx, Identity oid, Object obj)
    {
        ClassDescriptor cld = tx.getBroker().getClassDescriptor(ProxyHelper.getRealClass(obj));
        int isolationLevel = cld.getIsolationLevel();
        return ignore(isolationLevel) ? true : lm.upgradeLock(tx.getGUID(), oid, isolationLevel);
    }
View Full Code Here

                            || mod.hasChanged(tx.getBroker())))
                    {
                        needsCommit = true;
                        // mark object dirty
                        mod.setModificationState(mod.getModificationState().markDirty());
                        ClassDescriptor cld = mod.getClassDescriptor();
                        // if the object isn't already locked, we will do it now
                        if(!mod.isWriteLocked())
                        {
                            tx.doSingleLock(cld, mod.getObject(), mod.getIdentity(), Transaction.WRITE);
                        }
View Full Code Here

    {
        // avoid endless recursion, so use List for registration
        if(alreadyPrepared.contains(mod.getIdentity())) return;
        alreadyPrepared.add(mod.getIdentity());

        ClassDescriptor cld = getTransaction().getBroker().getClassDescriptor(mod.getObject().getClass());

        List refs = cld.getObjectReferenceDescriptors(true);
        cascadeInsertSingleReferences(mod, refs, alreadyPrepared);

        List colls = cld.getCollectionDescriptors(true);
        cascadeInsertCollectionReferences(mod, colls, alreadyPrepared);
    }
View Full Code Here

        // avoid endless recursion
        if(alreadyPrepared.contains(mod.getIdentity())) return;

        alreadyPrepared.add(mod.getIdentity());

        ClassDescriptor cld = getTransaction().getBroker().getClassDescriptor(mod.getObject().getClass());

        List refs = cld.getObjectReferenceDescriptors(true);
        cascadeDeleteSingleReferences(mod, refs, alreadyPrepared);

        List colls = cld.getCollectionDescriptors(true);
        cascadeDeleteCollectionReferences(mod, colls, alreadyPrepared);
    }
View Full Code Here

        arminw: use real object class instead of top-level class
        to match isolation level of given class
        */
        // Class clazz = lock.getTargetIdentity().getObjectsTopLevelClass();
        Class clazz = lock.getTargetIdentity().getObjectsRealClass();
        ClassDescriptor classDescriptor = pb.getClassDescriptor(clazz);
        int isolationLevel = classDescriptor.getIsolationLevel();

        TransactionIsolation isolation = null;
        switch (isolationLevel) {

            case IsolationLevels.IL_READ_UNCOMMITTED:
View Full Code Here

     * added to the edgeList map.
     * @param vertex the Vertex object to find edges for
     */
    private void addEdgesForVertex(Vertex vertex)
    {
        ClassDescriptor cld = vertex.getEnvelope().getClassDescriptor();
        Iterator rdsIter = cld.getObjectReferenceDescriptors(true).iterator();
        while (rdsIter.hasNext())
        {
            ObjectReferenceDescriptor rds = (ObjectReferenceDescriptor) rdsIter.next();
            addObjectReferenceEdges(vertex, rds);
        }
        Iterator cdsIter = cld.getCollectionDescriptors(true).iterator();
        while (cdsIter.hasNext())
        {
            CollectionDescriptor cds = (CollectionDescriptor) cdsIter.next();
            addCollectionEdges(vertex, cds);
        }
View Full Code Here

            Criteria crit = null;
            for (int i = 0; i < elements.size(); i++)
            {
                DListEntry entry = (DListEntry) elements.get(i);
                Object obj = entry.getRealSubject();
                ClassDescriptor cld = broker.getClassDescriptor(obj.getClass());

                FieldDescriptor[] pkFields = cld.getPkFields();
                ValueContainer[] pkValues = broker.serviceBrokerHelper().getKeyValues(cld, obj);

                Criteria criteria = new Criteria();
                for (int j = 0; j < pkFields.length; j++)
                {
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.metadata.ClassDescriptor

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.