Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.Query


        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date loadDate = df.parse("2004-04-26");

        String oql = "select t from " + Entity.class.getName() + " t " + " where t.loadDate=$1";
        Query qry = db.getOQLQuery(oql);
        qry.bind(loadDate);
        QueryResults qrs = qry.execute(AccessMode.ReadOnly);
        while (qrs.hasMore()) {
            Entity entity = (Entity) qrs.next();
            if (LOG.isTraceEnabled()) { LOG.trace(entity); }
        }
       
View Full Code Here


        if (_parentId != null) {
            _parent = (PersistentEntity) _db.load(
                    PersistentEntity.class, _parentId, accessMode);
        }

        Query qry = _db.getOQLQuery("SELECT p FROM " + PersistentEntity.class.getName()
                + " p WHERE parentId=$1");
        qry.bind(_id);
        QueryResults res = qry.execute();
        while (res.hasMore()) { _children.addElement(res.next()); }
        _origChildren = (Vector) _children.clone();
        _origRelated = _related;
        return null;
    }
View Full Code Here

        if (_parentId != null) {
            _parent = (PersistentObject) _db.load(PersistentObject.class,
                                                _parentId, accessMode);
        }

        Query qry = _db.getOQLQuery("SELECT p FROM "
                + PersistentObject.class.getName() + " p WHERE parentId=$1");
        qry.bind(_id);
        QueryResults res = qry.execute();
        while (res.hasMore()) {
            _children.addElement(res.next());
        }
       
        _origChildren = (Vector) _children.clone();
View Full Code Here

        if (_parentId != null) {
            _parent = (PersistentEntity) _db.load(
                    PersistentEntity.class, _parentId, accessMode);
        }

        Query qry = _db.getOQLQuery("SELECT p FROM " + PersistentEntity.class.getName()
                + " p WHERE parentId=$1");
        qry.bind(_id);
        QueryResults res = qry.execute();
        while (res.hasMore()) { _children.addElement((PersistentEntity) res.next()); }
        _origChildren = new Vector < PersistentEntity > (_children);
        _origRelated = _related;
        return null;
    }
View Full Code Here


    public Collection getProducts()
        throws PersistenceException
    {
        Query        qry;
        QueryResults res;

        if ( _products == null ) {
            _products = new ArrayList();
            qry = _db.getOQLQuery( "SELECT p FROM Product p WHERE p.category=$1" );
            qry.bind( _categoryId );
            res = qry.execute();
            while ( res.hasMore() )
                _products.add( res.next() );
        }
        return _products;
    }
View Full Code Here

TOP

Related Classes of org.exolab.castor.jdo.Query

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.