Package org.apache.tuscany.das.rdb.config.wrapper

Examples of org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper


    private ConfigFactory factory = ConfigFactory.INSTANCE;

    public ConfigHelper() {
        config = factory.createConfig();
        configWrapper = new MappingWrapper(config);
    }
View Full Code Here


        configWrapper = new MappingWrapper(config);
    }

    public ConfigHelper(Config config) {
        this.config = config;
        configWrapper = new MappingWrapper(config);
    }
View Full Code Here

    private boolean hasState(Property ref, DataObject changedObject) {
        if (ref.getOpposite().isMany()) {
            return true;
        }

        MappingWrapper mw = this.mapping;
        if (mw.getConfig() == null) {
            mw = registry.getFactory(changedObject.getType()).getConfig();
        }
        if (mw.getConfig() == null) {
            return false;
        }

        Relationship rel = mw.getRelationshipByReference(ref);

        if (!rel.isMany()) {
            if (rel.isKeyRestricted()) {
                throw new RuntimeException("Can not modify a one to one relationship that is key restricted");
            }
View Full Code Here

    private Property parentReference;

    private Map keyMappings = new HashMap();

    public DatabaseObject(Config model, DataObject changedObject) {
        this.mappingWrapper = new MappingWrapper(model);
        this.dataObject = changedObject;
        initialize();
    }
View Full Code Here

    public DataObject get(String tablePropertyName) {
        return (DataObject) objectsByTableName.get(tablePropertyName);
    }

    void processRelationships() {
        MappingWrapper wrapper = metadata.getConfigWrapper();
        if (wrapper.hasRecursiveRelationships()) {
            processRecursiveRelationships(wrapper);
            return;
        }

        Iterator i = metadata.getRelationships().iterator();
        while (i.hasNext()) {
            Relationship r = (Relationship) i.next();

            DataObject parentTable = get(wrapper.getTableTypeName(r.getPrimaryKeyTable()));
            DataObject childTable = get(wrapper.getTableTypeName(r.getForeignKeyTable()));

            if (this.logger.isDebugEnabled()) {
                this.logger.debug("Parent table: " + parentTable);
                this.logger.debug("Child table: " + childTable);
            }
View Full Code Here

    private Type rootType;

    private TypeHelper typeHelper = SDOUtil.createTypeHelper();

    public GraphBuilderMetadata(Collection results, Config model, ResultSetShape shape) throws SQLException {
        this.configWrapper = new MappingWrapper(model);
        if (model != null) {
            this.typeURI = model.getDataObjectModel();
        }

        Iterator i = results.iterator();
View Full Code Here

                }

            }
        }

        MappingWrapper wrapper = getConfigWrapper();
        Iterator i = getRelationships().iterator();
        while (i.hasNext()) {
            Relationship r = (Relationship) i.next();

            String parentName = wrapper.getTableTypeName(r.getPrimaryKeyTable());
            String childName = wrapper.getTableTypeName(r.getForeignKeyTable());

            if (parentName == null) {
                throw new RuntimeException("The parent table (" + r.getPrimaryKeyTable()
                        + ") in relationship " + r.getName()
                        + " was not found in the mapping information.");
View Full Code Here

    public DASImpl(Config inConfig) {
        Config cfg = inConfig;
        if (cfg == null) {
            cfg = ConfigFactory.INSTANCE.createConfig();
        }
        this.configWrapper = new MappingWrapper(cfg);

        Iterator i = configWrapper.getConfig().getCommand().iterator();
        while (i.hasNext()) {
            org.apache.tuscany.das.rdb.config.Command commandConfig =
                (org.apache.tuscany.das.rdb.config.Command) i.next();
View Full Code Here

    public Command createCommand(String sql) {
        return baseCreateCommand(sql, this.configWrapper);
    }

    public Command createCommand(String sql, Config config) {
        return baseCreateCommand(sql, new MappingWrapper(config));
    }
View Full Code Here

        CONFIG.setDataObjectModel("http:///org.apache.tuscany.das.rdb.test/customer.xsd");
    }

    public ReadCustomersStaticTypesCommand() {
        super(SQL_STRING, new MappingWrapper(CONFIG), null);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper

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.