Package commonj.sdo

Examples of commonj.sdo.Property


        }

        Iterator i = types.iterator();
        while (i.hasNext()) {
            Type type = (Type) i.next();
            Property property = SDOUtil.createProperty(root, type.getName(), type);
            SDOUtil.setContainment(property, true);
            SDOUtil.setMany(property, true);
        }
        this.rootType = root;
    }
View Full Code Here


    }

    private Type findTableTypeByPropertyName(String tableName) {
        Iterator i = rootObject.getType().getProperties().iterator();
        while (i.hasNext()) {
            Property p = (Property) i.next();
            if (tableName.equals(p.getType().getName())) {
                return p.getType();
            }
        }

        return null;
    }
View Full Code Here

        // care
        // of when we process relationships

        Iterator i = this.rootObject.getType().getProperties().iterator();
        while (i.hasNext()) {
            Property p = (Property) i.next();

            if (p.isContainment() && p.getType().equals(tableClass)) {
                if (p.isMany()) {
                    rootObject.getList(p).add(obj);
                } else {
                    this.rootObject.set(p, obj);
                }
            }

        }

        Iterator columnNames = resultMetadata.getPropertyNames(tableData.getTableName()).iterator();
        while (columnNames.hasNext()) {
            String propertyName = (String) columnNames.next();

            Property p = findProperty(obj.getType(), propertyName);
            if (p == null) {
                throw new RuntimeException("Type " + obj.getType().getName()
                        + " does not contain a property named " + propertyName);
            }
View Full Code Here

    // temporary, ignoring case
    private Property findProperty(Type type, String columnName) {
        Iterator properties = type.getProperties().iterator();
        while (properties.hasNext()) {
            Property p = (Property) properties.next();
            if (columnName.equalsIgnoreCase(p.getName())) {
                return p;
            }
        }
        return null;
    }
View Full Code Here

        if(isModified(sdoDataObject)) {
            modifiedList.add(sdoDataObject);
        }
        List<Property> properties = (List<Property>) sdoDataObject.getInstanceProperties();
        for(int x=0; x<properties.size(); x++) {
            Property property = properties.get(x);
            if(property.isContainment()) {
                if(property.isMany()) {
                    List<SDODataObject> dataObjects = (List<SDODataObject>) sdoDataObject.getList(property);
                    for(int y=0; y<dataObjects.size(); y++) {
                        getModified(dataObjects.get(y), modifiedList);
                    }
                } else {
                    if ((property.getType() != null) && !(((SDOType)property.getType()).isChangeSummaryType())) {
                        getModified((SDODataObject) sdoDataObject.getDataObject(property), modifiedList);
                    }
                }
            }
        }
View Full Code Here

                if (nextOriginalSettingValue == null) {
                    continue;
                }

                // property may be null if the setting contains unstructured text
                Property nextOriginalSettingProp = originalSeq.getProperty(i);
                if (nextOriginalSettingProp == null) {
                    // handle unstructured text
                    seqWithDeepCopies.addText(nextOriginalSettingValue.toString());
                } else if (nextOriginalSettingProp.getType().isDataType()) {
                    // handle simple types
                    seqWithDeepCopies.addSettingWithoutModifyingDataObject(nextOriginalSettingProp, nextOriginalSettingValue, false);
                } else {
                    // handle complex types
                    seqWithDeepCopies.addSettingWithoutModifyingDataObject(nextOriginalSettingProp, getOrCreateDeepCopy((DataObject) nextOriginalSettingValue), false);
View Full Code Here

        /**
         * See Jira SDO-109/107 and 125/225 for open issues with move optimization
         * See bug#5882923 for smart local undo via set()/unset()
         */
        Property oldProp = getOldContainmentProperty(rootDataObject);
        String oldName = null;
        if (oldProp != null) {
            oldName = oldProp.getName();
        }
        rootDataObject.undoChanges(true, this, (SDODataObject)getOldContainer(rootDataObject), oldName);
        resetChanges();
        rootDataObject.resetChanges();
    }
View Full Code Here

    public void setList(String path, List value) {
        convertValueAndSet(path, value);
    }

    public Object get(int propertyIndex) throws IllegalArgumentException {
        Property p = getInstanceProperty(propertyIndex);
        return get(p);
    }
View Full Code Here

        return get(p);
    }

    public void set(int propertyIndex, Object value) {
        try {
            Property p = getInstanceProperty(propertyIndex);
            set(p, value);
        } catch (IndexOutOfBoundsException e) {
            throw new IllegalArgumentException("PropertyIndex invalid.");
        }
    }
View Full Code Here

            throw new IllegalArgumentException("PropertyIndex invalid.");
        }
    }

    public boolean isSet(int propertyIndex) {
        Property p = getInstanceProperty(propertyIndex);
        return isSet(p);
    }
View Full Code Here

TOP

Related Classes of commonj.sdo.Property

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.