Package helma.objectmodel.db

Examples of helma.objectmodel.db.DbMapping


        } else if (repository != null) {
            props.addResource(repository.getResource("type.properties"));
            props.addResource(repository.getResource(name + ".properties"));
        }

        dbmap = new DbMapping(app, name, props);
        // we don't need to put the DbMapping into proto.updatables, because
        // dbmappings are checked separately in TypeManager.checkFiles() for
        // each request

        code = new TreeSet(app.getResourceComparator());
View Full Code Here


            if (debug) {
                System.err.println("CHECK: " + proto.getName() + " in " + Thread.currentThread());
            }           

            // update prototype's type mapping
            DbMapping dbmap = proto.getDbMapping();

            if ((dbmap != null) && dbmap.needsUpdate()) {
                // call dbmap.update(). This also checks the
                // parent prototype for prototypes other than
                // global and HopObject, which is a bit awkward...
                // I mean we're the type manager, so this should
                // be part of our job, right?
                proto.props.update();
                dbmap.update();
            }
        }
        if (debug) {
            System.err.println("Finished CHECK in " + Thread.currentThread());
        }
View Full Code Here

     * loop through the children-array and print them as <hop:child>
     */
    private void writeChildren(INode node, int level) throws IOException {
        if (dbmode && node instanceof Node) {
            Node dbNode = (Node) node;
            DbMapping smap = (dbNode.getDbMapping() == null) ? null
                                                             : dbNode.getDbMapping()
                                                                     .getSubnodeMapping();

            if ((smap != null) && smap.isRelational()) {
                return;
            }
        }

        Enumeration e = node.getSubnodes();
View Full Code Here

            if (op == null) {
                // maybe this object has a prototype name that has been
                // deleted, but the storage layer was able to set a
                // DbMapping matching the relational table the object
                // was fetched from.
                DbMapping dbmap = node.getDbMapping();
                if (dbmap != null && (protoname = dbmap.getTypeName()) != null) {
                    op = getValidPrototype(protoname);
                }

                // if not found, fall back to HopObject prototype
                if (op == null) {
View Full Code Here

            // Otherwise, use our own type name.
            String type = args.length == 1 ?
                    HopObjectCtor.this.getFunctionName() :
                    Context.toString(args[1]);

            DbMapping dbmap = core.app.getDbMapping(type);
            if (dbmap == null)
                return null;
            Object node = null;
            try {
                DbKey key = new DbKey(dbmap, Context.toString(args[0]));
View Full Code Here

                childmapping.put("collection", HopObjectCtor.this.getFunctionName());
            }

            Properties props = new Properties();
            props.put("_children", childmapping);
            DbMapping dbmap = new DbMapping(core.app, null, props, true);
            dbmap.update();

            WrappedNodeManager nmgr = core.app.getWrappedNodeManager();
            Node node = new Node("HopQuery", Long.toString(collectionId++), null, nmgr);
            node.setDbMapping(dbmap);
            node.setState(Node.VIRTUAL);
View Full Code Here

        }

        // if this is a HopObject, check if the property is defined
        // in the type.properties db-mapping.
        if (obj instanceof INode && ! "hopobject".equalsIgnoreCase(prototypeName)) {
            DbMapping dbm = app.getDbMapping(prototypeName);
            if (dbm != null) {
                Relation rel = dbm.propertyToRelation(propname);
                if (rel != null && (rel.isPrimitive() || rel.isCollection()))
                    return true;
            }
        }
        Scriptable wrapped = Context.toObject(obj, global);
View Full Code Here

TOP

Related Classes of helma.objectmodel.db.DbMapping

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.