Package org.apache.ojb.broker.query

Examples of org.apache.ojb.broker.query.QueryByCriteria


    {
        if (null == clients)
        {
      try
      {
        QueryByCriteria query = QueryFactory.newQuery(getClientClass(), new Criteria());
              query.addOrderByAscending("evalOrder");
              this.clients = getPersistenceBrokerTemplate().getCollectionByQuery(query);
        }
        catch (Exception e)
        {
              String message =
View Full Code Here


        if (temp.size() > 0)
        {
      try
      {
        filter.addIn("mimetypes.name", temp);
                  QueryByCriteria query = QueryFactory.newQuery(getMediaTypeClass(), filter);
                  co = getPersistenceBrokerTemplate().getCollectionByQuery(query);           
      }
      catch (Exception e)
      {
          String message =
View Full Code Here

    {       
      try
      {
          Criteria filter = new Criteria();       
          filter.addEqualTo("name", mediaType);
          QueryByCriteria query = QueryFactory.newQuery(getMediaTypeClass(), filter);
          return (MediaType) getPersistenceBrokerTemplate().getObjectByQuery(query);                  
    }
    catch (Exception e)
    {
          String message =
View Full Code Here

    try
    {
          Criteria filter = new Criteria();      
          filter.addEqualTo("mimetypes.name", mimeTypeName);
         
          QueryByCriteria query = QueryFactory.newQuery(getMediaTypeClass(), filter);
          mediaTypeCollection = getPersistenceBrokerTemplate().getCollectionByQuery(query);                   
    }
    catch (Exception e)
    {
          String message =
View Full Code Here

     * Obtain an iterator of all existing capabilities.
     * @return Returns an iterator for all existing Capabilities of type <code>Capability</code>
     */
    public Iterator getCapabilities()
    {
      QueryByCriteria query = null;
    try
    {
      query = QueryFactory.newQuery(getCapabilityClass(), new Criteria());
    }
    catch (Exception e)
    {
          String message =
              "CapabilityServiceImpl: getCapabilities query used invalid class ";
          log.error(message, e);
          return null;
    }
        query.addOrderByAscending("name");
        return getPersistenceBrokerTemplate().getCollectionByQuery(query).iterator();       
    }
View Full Code Here

     */
    public Iterator getMimeTypes()
    {
    try
    {
      QueryByCriteria query = QueryFactory.newQuery(getMimeTypeClass(), new Criteria());
          query.addOrderByAscending("name");
          return getPersistenceBrokerTemplate().getCollectionByQuery(query).iterator();               
    }
    catch (Exception e)
    {
          String message =
View Full Code Here

     */
    public Iterator getMediaTypes()
    {
    try
    {
      QueryByCriteria query = QueryFactory.newQuery(getMediaTypeClass(), new Criteria());
          query.addOrderByAscending("name");
          return getPersistenceBrokerTemplate().getCollectionByQuery(query).iterator();                       
    }
    catch (Exception e)
    {
          String message =
View Full Code Here

        // retrieve page from database
        try
        {
            Criteria filter = new Criteria();
            filter.addEqualTo("path", path);
            QueryByCriteria query = QueryFactory.newQuery(PageImpl.class, filter);
            Page page = (Page)getPersistenceBrokerTemplate().getObjectByQuery(query);
           
            // return page or throw exception
            if (page == null)
            {
View Full Code Here

        // retrieve link from database
        try
        {
            Criteria filter = new Criteria();
            filter.addEqualTo("path", path);
            QueryByCriteria query = QueryFactory.newQuery(LinkImpl.class, filter);
            Link link = (Link)getPersistenceBrokerTemplate().getObjectByQuery(query);
           
            // return link or throw exception
            if (link == null)
            {
View Full Code Here

        // retrieve document from database
        try
        {
            Criteria filter = new Criteria();
            filter.addEqualTo("path", path);
            QueryByCriteria query = QueryFactory.newQuery(PageSecurityImpl.class, filter);
            PageSecurity document = (PageSecurity)getPersistenceBrokerTemplate().getObjectByQuery(query);
           
            // return page or throw exception
            if (document == null)
            {
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.query.QueryByCriteria

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.