Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.PreparedQuery.asSingleEntity()


                throw new PreparedQuery.TooManyResultsException();
            }
            return list.get(0);
        }
        PreparedQuery pq = prepareQuery();
        return pq.asSingleEntity();
    }

    /**
     * Returns a list of keys.
     *
 
View Full Code Here


                throw new PreparedQuery.TooManyResultsException();
            }
            return list.get(0);
        }
        PreparedQuery pq = txSet ? ds.prepare(tx, query) : ds.prepare(query);
        return pq.asSingleEntity();
    }

    /**
     * Returns a list of keys.
     *
 
View Full Code Here

    DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
    PreparedQuery pq = ds.prepare(query);
   
    if (pq.countEntities(fetchOptions) == 1)
    {
      return pq.asSingleEntity();
    }
    else
    {
      return pq.asList(fetchOptions).get(0);
    }
View Full Code Here

    Query query = new Query(table, dbKey)
        .addSort("name", SortDirection.ASCENDING)
        .setFilter(idFilter);
   
    PreparedQuery pq = datastore.prepare(query);
    Entity entity = pq.asSingleEntity();

    if (entity != null) {
      HashMap<String, Object> properties = new HashMap<String, Object>();
      properties.putAll(entity.getProperties());
      attributes.put(table, properties);
View Full Code Here

   
    Query q = new Query("SysUser").setFilter(filter);
   
    PreparedQuery pq = datastore.prepare(q);

    Entity result = pq.asSingleEntity();
   
    if(result!=null){
     
      return true;
    }
View Full Code Here

   
    Query q1 = new Query("SysUser").setFilter(filter);
   
    PreparedQuery pq1 = datastore.prepare(q1);

    Entity result = pq1.asSingleEntity();
   
    if((boolean)result.getProperty("Active")){
     
      Logger logger=new Logger();
     
View Full Code Here

     
      Query q2 = new Query("UserRole").setFilter(filter);
     
      PreparedQuery pq2 = datastore.prepare(q1);

      Entity result2 = pq2.asSingleEntity();
     
      String roles=(String) result2.getProperty("Roles");
     
      logger.LoggerRoles=roles.split("-1");
     
View Full Code Here

        Query q3 = new Query("RoleFunction").setFilter(filterf);

        PreparedQuery pq3 = datastore.prepare(q3);

        Entity result3 = pq3.asSingleEntity();
       
       
        functionString += (String)result3.getProperty("Functions");
       
               
View Full Code Here

        Query q4 = new Query("Function").setFilter(filterF);

        PreparedQuery pq4 = datastore.prepare(q4);

        Entity result4 = pq4.asSingleEntity();
       
        logger.LoggerFunctions.add(result4);
       
       
       
View Full Code Here

     */
    public static Entity getProperty(DatastoreService service, String kind, String property) {
        Query query = new Query(Query.PROPERTY_METADATA_KIND);
        query.setAncestor(createPropertyKey(kind, property));
        PreparedQuery preparedQuery = service.prepare(query);
        return preparedQuery.asSingleEntity();
    }

    /**
     * Queries for meta data.
     *
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.