Package org.apache.ojb.broker.metadata.fieldaccess

Examples of org.apache.ojb.broker.metadata.fieldaccess.PersistentField


            super(owner, retrievalTasks, key, limit);
        }

        protected void addThisListenerTo(Object owner)
        {
            PersistentField collectionField =
                    ((CollectionDescriptor) _key).getPersistentField();
            _listenedCollection = (CollectionProxyDefaultImpl) collectionField.get(owner);
            _listenedCollection.addListener(this);
        }
View Full Code Here


     * The conversion of the keys of the mToNImplementor should solve this problem.
     */
    protected void associateBatched(Collection owners, Collection children, Collection mToNImplementors)
    {
        CollectionDescriptor cds = getCollectionDescriptor();
        PersistentField field = cds.getPersistentField();
        PersistenceBroker pb = getBroker();
        Class ownerTopLevelClass = pb.getTopLevelClass(getOwnerClassDescriptor().getClassOfObject());
        Class childTopLevelClass = pb.getTopLevelClass(getItemClassDescriptor().getClassOfObject());
        Class collectionClass = cds.getCollectionClass(); // this collection type will be used:
        HashMap childMap = new HashMap();
        HashMap ownerIdsToLists = new HashMap();
        FieldConversion[] ownerFc = getPkFieldConversion(getOwnerClassDescriptor());
        FieldConversion[] childFc = getPkFieldConversion(getItemClassDescriptor())

        // initialize the owner list map
        for (Iterator it = owners.iterator(); it.hasNext();)
        {
            Object owner = it.next();
            Identity oid = pb.serviceIdentity().buildIdentity(owner);
            ownerIdsToLists.put(oid, new ArrayList());
        }

        // build the children map
        for (Iterator it = children.iterator(); it.hasNext();)
        {
            Object child = it.next();
            Identity oid = pb.serviceIdentity().buildIdentity(child);
            childMap.put(oid, child);
        }

        int ownerPkLen = getOwnerClassDescriptor().getPkFields().length;
        int childPkLen = getItemClassDescriptor().getPkFields().length;
        Object[] ownerPk = new Object[ownerPkLen];
        Object[] childPk = new Object[childPkLen];

        // build list of children based on m:n implementors
        for (Iterator it = mToNImplementors.iterator(); it.hasNext();)
        {
            Object[] mToN = (Object[]) it.next();
            System.arraycopy(mToN, 0, ownerPk, 0, ownerPkLen);
            System.arraycopy(mToN, ownerPkLen, childPk, 0, childPkLen);

            // BRJ: apply the FieldConversions, OJB296
            ownerPk = convert(ownerFc, ownerPk);
            childPk = convert(childFc, childPk);

            Identity ownerId = pb.serviceIdentity().buildIdentity(null, ownerTopLevelClass, ownerPk);
            Identity childId = pb.serviceIdentity().buildIdentity(null, childTopLevelClass, childPk);

            // Identities may not be equal due to type-mismatch
            Collection list = (Collection) ownerIdsToLists.get(ownerId);
            Object child = childMap.get(childId);
            list.add(child);
        }

        // connect children list to owners
        for (Iterator it = owners.iterator(); it.hasNext();)
        {
            Object result;
            Object owner = it.next();
            Identity ownerId = pb.serviceIdentity().buildIdentity(owner);

            List list = (List) ownerIdsToLists.get(ownerId);

            if ((collectionClass == null) && field.getType().isArray())
            {
                int length = list.size();
                Class itemtype = field.getType().getComponentType();

                result = Array.newInstance(itemtype, length);

                for (int j = 0; j < length; j++)
                {
                    Array.set(result, j, list.get(j));
                }
            }
            else
            {
                ManageableCollection col = createCollection(cds, collectionClass);

                for (Iterator it2 = list.iterator(); it2.hasNext();)
                {
                    col.ojbAdd(it2.next());
                }
                result = col;
            }

            Object value = field.get(owner);
            if ((value instanceof CollectionProxyDefaultImpl) && (result instanceof Collection))
            {
                ((CollectionProxyDefaultImpl) value).setData((Collection) result);
            }
            else
            {
                field.set(owner, result);
            }
        }

    }
View Full Code Here

    private void runFieldTestsFor(Class targetClass, boolean supportJavaBeanNames) throws Exception
    {
        ((OjbConfiguration) OjbConfigurator.getInstance().getConfigurationFor(null)).setPersistentFieldClass(targetClass);

        PersistentField pfNM_Name = newInstance(targetClass, NestedMain.class, NESTED_MAIN_NAME);
        PersistentField pfNDD_RD = newInstance(targetClass, NestedMain.class, NESTED_DETAIL_DETAIL_REAL_DETAIL);
        PersistentField pfNDD_RDD = newInstance(targetClass, NestedMain.class, NESTED_DETAIL_DETAIL_REAL_DESCRIPTION);
        PersistentField pfND_MJB = null;
        PersistentField pfNE_Name = null;
        if (supportJavaBeanNames)
        {
            pfND_MJB = newInstance(targetClass, NestedMain.class, NESTED_DETAIL_MORE_JAVA_BEAN);
            pfNE_Name = newInstance(targetClass, NestedMain.class, NESTED_ENTRY_NAME);
        }

        // test getter
        NestedMain nm = createNestedObject();
        Object result = pfNM_Name.get(nm);
        assertEquals(NESTED_MAIN_NAME_VALUE, result);
        result = pfNDD_RD.get(nm);
        assertEquals(NESTED_DETAIL_DETAIL_REAL_DETAIL_VALUE, result);
        result = pfNDD_RDD.get(nm);
        assertEquals(NESTED_DETAIL_DETAIL_REAL_DESCRIPTION_VALUE, result);

        if (supportJavaBeanNames)
        {
            result = pfND_MJB.get(nm);
            assertEquals(NESTED_DETAIL_MORE_JAVA_BEAN_VALUE, result);
            result = pfNE_Name.get(nm);
            assertEquals(NESTED_ENTRY_NAME_VALUE, result);
        }

        NestedMain newNM = new NestedMain();
        // test setter
        pfNM_Name.set(newNM, NESTED_MAIN_NAME_VALUE);
        pfNDD_RD.set(newNM, NESTED_DETAIL_DETAIL_REAL_DETAIL_VALUE);
        result = pfNDD_RDD.get(newNM);
        assertEquals(NESTED_DETAIL_DETAIL_REAL_DESCRIPTION_VALUE, result);

        result = pfNM_Name.get(newNM);
        assertEquals(NESTED_MAIN_NAME_VALUE, result);
        result = pfNDD_RD.get(newNM);
        assertEquals(NESTED_DETAIL_DETAIL_REAL_DETAIL_VALUE, result);

        if (supportJavaBeanNames)
        {
            pfND_MJB.set(newNM, NESTED_DETAIL_MORE_JAVA_BEAN_VALUE);
            pfNE_Name.set(newNM, NESTED_ENTRY_NAME_VALUE);
            result = pfND_MJB.get(newNM);
            assertEquals(NESTED_DETAIL_MORE_JAVA_BEAN_VALUE, result);
            result = pfNE_Name.get(newNM);
            assertEquals(NESTED_ENTRY_NAME_VALUE, result);
        }

        // serialize fields and test again
        pfNM_Name = (PersistentField) SerializationUtils.deserialize(SerializationUtils.serialize(pfNM_Name));
        pfNDD_RD = (PersistentField) SerializationUtils.deserialize(SerializationUtils.serialize(pfNDD_RD));
        pfNDD_RDD = (PersistentField) SerializationUtils.deserialize(SerializationUtils.serialize(pfNDD_RDD));
        if (supportJavaBeanNames)
        {
            pfND_MJB = (PersistentField) SerializationUtils.deserialize(SerializationUtils.serialize(pfND_MJB));
            pfNE_Name = (PersistentField) SerializationUtils.deserialize(SerializationUtils.serialize(pfNE_Name));
        }

        // test getter
        nm = createNestedObject();
        result = pfNM_Name.get(nm);
        assertEquals(NESTED_MAIN_NAME_VALUE, result);
        result = pfNDD_RD.get(nm);
        assertEquals(NESTED_DETAIL_DETAIL_REAL_DETAIL_VALUE, result);
        result = pfNDD_RDD.get(nm);
        assertEquals(NESTED_DETAIL_DETAIL_REAL_DESCRIPTION_VALUE, result);

        if (supportJavaBeanNames)
        {
            result = pfND_MJB.get(nm);
            assertEquals(NESTED_DETAIL_MORE_JAVA_BEAN_VALUE, result);
            result = pfNE_Name.get(nm);
            assertEquals(NESTED_ENTRY_NAME_VALUE, result);
        }

        newNM = new NestedMain();
        // test setter
        pfNM_Name.set(newNM, NESTED_MAIN_NAME_VALUE);
        pfNDD_RD.set(newNM, NESTED_DETAIL_DETAIL_REAL_DETAIL_VALUE);
        result = pfNDD_RDD.get(newNM);
        assertEquals(NESTED_DETAIL_DETAIL_REAL_DESCRIPTION_VALUE, result);

        result = pfNM_Name.get(newNM);
        assertEquals(NESTED_MAIN_NAME_VALUE, result);
        result = pfNDD_RD.get(newNM);
        assertEquals(NESTED_DETAIL_DETAIL_REAL_DETAIL_VALUE, result);

        if (supportJavaBeanNames)
        {
            pfND_MJB.set(newNM, NESTED_DETAIL_MORE_JAVA_BEAN_VALUE);
            pfNE_Name.set(newNM, NESTED_ENTRY_NAME_VALUE);
            result = pfND_MJB.get(newNM);
            assertEquals(NESTED_DETAIL_MORE_JAVA_BEAN_VALUE, result);
            result = pfNE_Name.get(newNM);
            assertEquals(NESTED_ENTRY_NAME_VALUE, result);
        }
    }
View Full Code Here

        checkBoundaryConditions(targetClass, true);
    }

    private void checkBoundaryConditions(Class targetClass, boolean withNested) throws Exception
    {
        PersistentField pf = newInstance(targetClass, NestedMain.class, NESTED_MAIN_NAME);
        pf.get(null);
        pf.set(null, null);
        pf = newInstance(targetClass, NestedMain.class, NESTED_MAIN_NAME);
        pf.get(null);
        pf.set(null, "kkddk");
        if(withNested)
        {
            PersistentField pf_2 = newInstance(targetClass, NestedMain.class, NESTED_DETAIL_DETAIL_REAL_DETAIL);
            pf_2.get(null);
            pf_2.set(null, null);
            pf_2 = newInstance(targetClass, NestedMain.class, NESTED_DETAIL_DETAIL_REAL_DETAIL);
            pf_2.get(null);
            pf_2.set(null, "gkfgfg");
        }
    }
View Full Code Here

        for (int i = 0; i < fields.length; i++)
        {
            FieldDescriptor fmd = fields[i];
            if (fmd.isUpdateLock())
            {
                PersistentField f = fmd.getPersistentField();
                Object cv = f.get(obj);
                // int
                if ((f.getType() == int.class) || (f.getType() == Integer.class))
                {
                    int newCv = 0;
                    if (cv != null)
                    {
                        newCv = ((Number) cv).intValue();
                    }
                    newCv++;
                    f.set(obj, new Integer(newCv));
                }
                // long
                else if ((f.getType() == long.class) || (f.getType() == Long.class))
                {
                    long newCv = 0;
                    if (cv != null)
                    {
                        newCv = ((Number) cv).longValue();
                    }
                    newCv++;
                    f.set(obj, new Long(newCv));
                }
                // Timestamp
                else if (f.getType() == Timestamp.class)
                {
                    long newCv = System.currentTimeMillis();
                    f.set(obj, new Timestamp(newCv));
                }
            }
        }
    }
View Full Code Here

        if(fields == null)
        {
            fields = new HashMap();
            declaredInheritanceFields.put(target, fields);
        }
        PersistentField pf = (PersistentField) fields.get(name);
        if(pf == null)
        {
            pf = PersistentFieldFactory.createPersistentField(target, name);
            // System.out.println("## tmp field: " + target + ", name: " + name + ", field: " + pf);
            fields.put(name, pf);
View Full Code Here

            }
            List refs = targetIsSuper ? targetCld.getCollectionDescriptors() : sourceCld.getCollectionDescriptors();
            for(int i = 0; i < refs.size(); i++)
            {
                CollectionDescriptor col = (CollectionDescriptor) refs.get(i);
                PersistentField pf = col.getPersistentField();
                performFieldCopy(target,  targetCld, source, sourceCld, pf, targetIsSuper, javaInheritance);
            }

            refs = targetIsSuper ? targetCld.getObjectReferenceDescriptors() : sourceCld.getObjectReferenceDescriptors();
            for(int i = 0; i < refs.size(); i++)
            {
                ObjectReferenceDescriptor ord = (ObjectReferenceDescriptor) refs.get(i);
                PersistentField pf = ord.getPersistentField();
                performFieldCopy(target,  targetCld, source, sourceCld, pf, targetIsSuper, javaInheritance);
            }
        }
View Full Code Here

                        log.error("Declared inheritance doesn't support nested super references, target '"
                                + targetCld.getClassNameOfObject() + "' has super reference");
                    }
                    else
                    {
                        PersistentField tmp = superRef.getDeclaredInheritanceField(sourceCld.getClassOfObject(), pf.getName());
                        pf.set(target, tmp.get(source));
                    }
                }
                else
                {
                    PersistentField tmp = superRef.getDeclaredInheritanceField(targetCld.getClassOfObject(), pf.getName());
                    tmp.set(target, pf.get(source));
                }
            }
        }
View Full Code Here

                            anonymous.setPersistentField(null,fieldName);
                        }
                        else
                        {
                            String classname = m_CurrentCLD.getClassNameOfObject();
              PersistentField pf = PersistentFieldFactory.createPersistentField(m_CurrentCLD.getPersistentFieldClassName(),ClassHelper.getClass(classname),fieldName);
                            m_CurrentFLD.setPersistentField(pf);
                        }

                        String columnName = atts.getValue(tags.getTagById(COLUMN_NAME));
                        if (isDebug) logger.debug("     " + tags.getTagById(COLUMN_NAME) + ": " + columnName);
                        m_CurrentFLD.setColumnName(columnName);

                        String jdbcType = atts.getValue(tags.getTagById(JDBC_TYPE));
                        if (isDebug) logger.debug("     " + tags.getTagById(JDBC_TYPE) + ": " + jdbcType);
                        m_CurrentFLD.setColumnType(jdbcType);

                        String primaryKey = atts.getValue(tags.getTagById(PRIMARY_KEY));
                        if (isDebug) logger.debug("     " + tags.getTagById(PRIMARY_KEY) + ": " + primaryKey);
                        boolean b = (Boolean.valueOf(primaryKey)).booleanValue();
                        m_CurrentFLD.setPrimaryKey(b);

                        String nullable = atts.getValue(tags.getTagById(NULLABLE));
                        if (nullable != null)
                        {
                            if (isDebug) logger.debug("     " + tags.getTagById(NULLABLE) + ": " + nullable);
                            b = !(Boolean.valueOf(nullable)).booleanValue();
                            m_CurrentFLD.setRequired(b);
                        }

                        String indexed = atts.getValue(tags.getTagById(INDEXED));
                        if (isDebug) logger.debug("     " + tags.getTagById(INDEXED) + ": " + indexed);
                        b = (Boolean.valueOf(indexed)).booleanValue();
                        m_CurrentFLD.setIndexed(b);

                        String autoincrement = atts.getValue(tags.getTagById(AUTO_INCREMENT));
                        if (isDebug) logger.debug("     " + tags.getTagById(AUTO_INCREMENT) + ": " + autoincrement);
                        b = (Boolean.valueOf(autoincrement)).booleanValue();
                        m_CurrentFLD.setAutoIncrement(b);

                        String sequenceName = atts.getValue(tags.getTagById(SEQUENCE_NAME));
                        if (isDebug) logger.debug("     " + tags.getTagById(SEQUENCE_NAME) + ": " + sequenceName);
                        m_CurrentFLD.setSequenceName(sequenceName);

                        String locking = atts.getValue(tags.getTagById(LOCKING));
                        if (isDebug) logger.debug("     " + tags.getTagById(LOCKING) + ": " + locking);
                        b = (Boolean.valueOf(locking)).booleanValue();
                        m_CurrentFLD.setLocking(b);

                        String updateLock = atts.getValue(tags.getTagById(UPDATE_LOCK));
                        if (isDebug) logger.debug("     " + tags.getTagById(UPDATE_LOCK) + ": " + updateLock);
                        if(checkString(updateLock))
                        {
                            b = (Boolean.valueOf(updateLock)).booleanValue();
                            m_CurrentFLD.setUpdateLock(b);
                        }

                        String fieldConversion = atts.getValue(tags.getTagById(FIELD_CONVERSION));
                        if (isDebug) logger.debug("     " + tags.getTagById(FIELD_CONVERSION) + ": " + fieldConversion);
                        if (fieldConversion != null)
                        {
                            m_CurrentFLD.setFieldConversionClassName(fieldConversion);
                        }

                        // set length attribute
                        String length = atts.getValue(tags.getTagById(LENGTH));
                        if (length != null)
                        {
                            int i = Integer.parseInt(length);
                            if (isDebug) logger.debug("     " + tags.getTagById(LENGTH) + ": " + i);
                            m_CurrentFLD.setLength(i);
                            m_CurrentFLD.setLengthSpecified(true);
                        }

                        // set precision attribute
                        String precision = atts.getValue(tags.getTagById(PRECISION));
                        if (precision != null)
                        {
                            int i = Integer.parseInt(precision);
                            if (isDebug) logger.debug("     " + tags.getTagById(PRECISION) + ": " + i);
                            m_CurrentFLD.setPrecision(i);
                            m_CurrentFLD.setPrecisionSpecified(true);
                        }

                        // set scale attribute
                        String scale = atts.getValue(tags.getTagById(SCALE));
                        if (scale != null)
                        {
                            int i = Integer.parseInt(scale);
                            if (isDebug) logger.debug("     " + tags.getTagById(SCALE) + ": " + i);
                            m_CurrentFLD.setScale(i);
                            m_CurrentFLD.setScaleSpecified(true);
                        }

                        break;
                    }

                case REFERENCE_DESCRIPTOR:
                    {
                        if (isDebug) logger.debug("    > " + tags.getTagById(REFERENCE_DESCRIPTOR));
                        // set name attribute
                        name = atts.getValue(tags.getTagById(FIELD_NAME));
                        if (isDebug) logger.debug("     " + tags.getTagById(FIELD_NAME) + ": " + name);

                        // set class-ref attribute
                        String classRef = atts.getValue(tags.getTagById(REFERENCED_CLASS));
                        if (isDebug) logger.debug("     " + tags.getTagById(REFERENCED_CLASS) + ": " + classRef);

                        ObjectReferenceDescriptor ord;
                        if (name.equals(TAG_SUPER))
                        {
                            // no longer needed sine SuperReferenceDescriptor was used
//                            checkThis(classRef);
//                            AnonymousObjectReferenceDescriptor aord =
//                                new AnonymousObjectReferenceDescriptor(m_CurrentCLD);
//                            aord.setPersistentField(null, TAG_SUPER);
//                            ord = aord;

                            ord = new SuperReferenceDescriptor(m_CurrentCLD);
                        }
                        else
                        {
                            ord = new ObjectReferenceDescriptor(m_CurrentCLD);
                            PersistentField pf = PersistentFieldFactory.createPersistentField(m_CurrentCLD.getPersistentFieldClassName(),m_CurrentCLD.getClassOfObject(),name);
                            ord.setPersistentField(pf);
                        }
                        m_CurrentORD = ord;

                        // now we add the new descriptor
                        m_CurrentCLD.addObjectReferenceDescriptor(m_CurrentORD);
                        m_CurrentORD.setItemClass(ClassHelper.getClass(classRef));

                        // prepare for custom attributes
                        this.m_CurrentAttrContainer = m_CurrentORD;

                        // set proxy attribute
                        String proxy = atts.getValue(tags.getTagById(PROXY_REFERENCE));
                        if (isDebug) logger.debug("     " + tags.getTagById(PROXY_REFERENCE) + ": " + proxy);
                        boolean b = (Boolean.valueOf(proxy)).booleanValue();
                        m_CurrentORD.setLazy(b);

                        // set proxyPrefetchingLimit attribute
                        String proxyPrefetchingLimit = atts.getValue(tags.getTagById(PROXY_PREFETCHING_LIMIT));
                        if (isDebug) logger.debug("     " + tags.getTagById(PROXY_PREFETCHING_LIMIT) + ": " + proxyPrefetchingLimit);
                        if (proxyPrefetchingLimit == null)
                        {
                            m_CurrentORD.setProxyPrefetchingLimit(defProxyPrefetchingLimit);
                        }
                        else
                        {
                            m_CurrentORD.setProxyPrefetchingLimit(Integer.parseInt(proxyPrefetchingLimit));
                        }

                        // set refresh attribute
                        String refresh = atts.getValue(tags.getTagById(REFRESH));
                        if (isDebug) logger.debug("     " + tags.getTagById(REFRESH) + ": " + refresh);
                        b = (Boolean.valueOf(refresh)).booleanValue();
                        m_CurrentORD.setRefresh(b);

                        // set auto-retrieve attribute
                        String autoRetrieve = atts.getValue(tags.getTagById(AUTO_RETRIEVE));
                        if (isDebug) logger.debug("     " + tags.getTagById(AUTO_RETRIEVE) + ": " + autoRetrieve);
                        b = (Boolean.valueOf(autoRetrieve)).booleanValue();
                        m_CurrentORD.setCascadeRetrieve(b);

                        // set auto-update attribute
                        String autoUpdate = atts.getValue(tags.getTagById(AUTO_UPDATE));
                        if (isDebug) logger.debug("     " + tags.getTagById(AUTO_UPDATE) + ": " + autoUpdate);
                        if(autoUpdate != null)
                        {
                            m_CurrentORD.setCascadingStore(autoUpdate);
                        }

                        //set auto-delete attribute
                        String autoDelete = atts.getValue(tags.getTagById(AUTO_DELETE));
                        if (isDebug) logger.debug("     " + tags.getTagById(AUTO_DELETE) + ": " + autoDelete);

                        if(autoDelete != null)
                        {
                            m_CurrentORD.setCascadingDelete(autoDelete);
                        }

                        //set otm-dependent attribute
                        String otmDependent = atts.getValue(tags.getTagById(OTM_DEPENDENT));
                        if (isDebug) logger.debug("     " + tags.getTagById(OTM_DEPENDENT) + ": " + otmDependent);
                        b = (Boolean.valueOf(otmDependent)).booleanValue();
                        m_CurrentORD.setOtmDependent(b);

                        break;
                    }

                case FOREIGN_KEY:
                    {
                        if (isDebug) logger.debug("    > " + tags.getTagById(FOREIGN_KEY));
                        String fieldIdRef = atts.getValue(tags.getTagById(FIELD_ID_REF));

                        if (fieldIdRef != null)
                        {
                            if (isDebug) logger.debug("      " + tags.getTagById(FIELD_ID_REF) + ": " + fieldIdRef);

                            try
                            {
                                int fieldId;
                                fieldId = Integer.parseInt(fieldIdRef);
                                m_CurrentORD.addForeignKeyField(fieldId);
                            }
                            catch (NumberFormatException rex)
                            {
                                throw new MetadataException(tags.getTagById(FIELD_ID_REF)
                                        + " attribute must be an int. Found: "
                                        + fieldIdRef + ". Please check your repository file.", rex);
                            }
                        }
                        else
                        {
                            String fieldRef = atts.getValue(tags.getTagById(FIELD_REF));
                            if (isDebug) logger.debug("      " + tags.getTagById(FIELD_REF) + ": " + fieldRef);
                            m_CurrentORD.addForeignKeyField(fieldRef);
                        }
                        break;
                    }

                case COLLECTION_DESCRIPTOR:
                    {
                        if (isDebug) logger.debug("    > " + tags.getTagById(COLLECTION_DESCRIPTOR));
                        m_CurrentCOD = new CollectionDescriptor(m_CurrentCLD);


                        // prepare for custom attributes
                        this.m_CurrentAttrContainer = m_CurrentCOD;

                        // set name attribute
                        name = atts.getValue(tags.getTagById(FIELD_NAME));
                        if (isDebug) logger.debug("     " + tags.getTagById(FIELD_NAME) + ": " + name);
            PersistentField pf = PersistentFieldFactory.createPersistentField(m_CurrentCLD.getPersistentFieldClassName(),m_CurrentCLD.getClassOfObject(),name);
                        m_CurrentCOD.setPersistentField(pf);

                        // set collection-class attribute
                        String collectionClassName = atts.getValue(tags.getTagById(COLLECTION_CLASS));
                        if (collectionClassName != null)
View Full Code Here

        if(fks.length > 0) obj = ProxyHelper.getRealObject(obj);
        Object[] result = new Object[fks.length];
        for (int i = 0; i < result.length; i++)
        {
            FieldDescriptor fmd = fks[i];
            PersistentField f = fmd.getPersistentField();

            // BRJ: do NOT convert.
            // conversion is done when binding the sql-statement
            //
            // FieldConversion fc = fmd.getFieldConversion();
            // Object val = fc.javaToSql(f.get(obj));

            result[i] = f.get(obj);
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.metadata.fieldaccess.PersistentField

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.