org.apache.usergrid.persistence.Query.setResultsLevel()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(288)

本文整理了Java中org.apache.usergrid.persistence.Query.setResultsLevel方法的一些代码示例,展示了Query.setResultsLevel的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setResultsLevel方法的具体详情如下:
包路径:org.apache.usergrid.persistence.Query
类名称:Query
方法名:setResultsLevel

Query.setResultsLevel介绍

暂无

代码示例

代码示例来源:origin: apache/usergrid

  1. @Override
  2. public Results getTargetEntities( String connectionType, String connectedEntityType, Level level )
  3. throws Exception {
  4. //until this is refactored properly, we will delegate to a search by query
  5. Results raw = null;
  6. Preconditions.checkNotNull( connectionType, "connectionType cannot be null" );
  7. Query query = new Query();
  8. query.setConnectionType( connectionType );
  9. query.setEntityType( connectedEntityType );
  10. query.setResultsLevel( level );
  11. return searchTargetEntities( query );
  12. }

代码示例来源:origin: apache/usergrid

  1. query.setResultsLevel( Level.ALL_PROPERTIES );
  2. query.setCollection( collectionName );

代码示例来源:origin: apache/usergrid

  1. @Override
  2. public Results getFailedImportEntities(final UUID applicationId, final UUID importId, final UUID fileImportId,
  3. @Nullable final String ql, @Nullable final String cursor) {
  4. Preconditions.checkNotNull(applicationId, "applicationId must be specified");
  5. Preconditions.checkNotNull(importId, "importId must be specified");
  6. Preconditions.checkNotNull(fileImportId, "fileImportId must be specified");
  7. try {
  8. final EntityManager rootEm = emf.getEntityManager(emf.getManagementAppId());
  9. final FileImport importEntity = getFileImport(applicationId, importId, fileImportId);
  10. Query query = Query.fromQLNullSafe(ql);
  11. query.setCursor(cursor);
  12. query.setConnectionType(FileImportTracker.ERRORS_CONNECTION_NAME);
  13. query.setResultsLevel(Level.ALL_PROPERTIES);
  14. //set our entity type
  15. query.setEntityType(Schema.getDefaultSchema().getEntityType(FailedImportEntity.class));
  16. return rootEm.searchTargetEntities(importEntity, query);
  17. } catch (Exception e) {
  18. throw new RuntimeException("Unable to get import entity", e);
  19. }
  20. }

代码示例来源:origin: apache/usergrid

  1. @Override
  2. public Results getFileImports(final UUID applicationId, final UUID importId,
  3. @Nullable final String ql, @Nullable final String cursor) {
  4. Preconditions.checkNotNull(applicationId, "applicationId must be specified");
  5. Preconditions.checkNotNull(importId, "importId must be specified");
  6. try {
  7. final EntityManager rootEm = emf.getEntityManager(emf.getManagementAppId());
  8. final Import importEntity = getImport(applicationId, importId);
  9. Query query = Query.fromQLNullSafe(ql);
  10. query.setCursor(cursor);
  11. query.setConnectionType(IMPORT_FILE_INCLUDES_CONNECTION);
  12. query.setResultsLevel(Level.ALL_PROPERTIES);
  13. //set our entity type
  14. query.setEntityType(Schema.getDefaultSchema().getEntityType(FileImport.class));
  15. return rootEm.searchTargetEntities(importEntity, query);
  16. } catch (Exception e) {
  17. throw new RuntimeException("Unable to get import entity", e);
  18. }
  19. }

代码示例来源:origin: apache/usergrid

  1. query.setResultsLevel(Query.Level.IDS);
  2. devicesQuery.setResultsLevel(Query.Level.CORE_PROPERTIES);

代码示例来源:origin: apache/usergrid

  1. devicesQuery.setResultsLevel(Query.Level.CORE_PROPERTIES);
  2. devicesQuery.setLimit(50); // for now, assume a user has no more than 50 devices

代码示例来源:origin: apache/usergrid

  1. protected Iterator refIterator(EntityManager em, boolean useGraph) throws Exception {
  2. if ( query.getQl() == null && query.getSingleNameOrEmailIdentifier() != null){
  3. return new PagingResultsIterator( getHeadResults( em ), Level.REFS, null);
  4. }
  5. if ( type != null && uuid != null) {
  6. return new PagingResultsIterator( getHeadResults( em ), Level.REFS, null);
  7. }
  8. else {
  9. Query q = query;
  10. if ( query.getResultsLevel() != Level.REFS ) { // ensure REFS level
  11. q = new Query( q );
  12. q.setResultsLevel( Level.REFS );
  13. }
  14. if( useGraph){
  15. return new NotificationGraphIterator( em, source.refIterator( em, true), q );
  16. }else{
  17. return new MultiQueryIterator( em, source.refIterator( em, false ), q );
  18. }
  19. }
  20. }

代码示例来源:origin: apache/usergrid

  1. @Override
  2. public ServiceResults putItemsByQuery( ServiceContext context, Query query ) throws Exception {
  3. checkPermissionsForCollection( context );
  4. if ( context.moreParameters() ) {
  5. return getItemsByQuery( context, query );
  6. }
  7. query = new Query( query );
  8. query.setResultsLevel( Level.ALL_PROPERTIES );
  9. query.setLimit( 1000 );
  10. if ( !query.isReversedSet() ) {
  11. query.setReversed( isCollectionReversed( context ) );
  12. }
  13. Results r = em.searchCollection( context.getOwner(), context.getCollectionName(), query );
  14. if ( r.isEmpty() ) {
  15. throw new ServiceResourceNotFoundException( context );
  16. }
  17. updateEntities( context, r );
  18. return new ServiceResults( this, context, Type.COLLECTION, r, null, null );
  19. }

代码示例来源:origin: apache/usergrid

  1. query.setResultsLevel( level );

代码示例来源:origin: apache/usergrid

  1. @Override
  2. public ServiceResults deleteItemsByQuery( ServiceContext context, Query query ) throws Exception {
  3. checkPermissionsForCollection( context );
  4. if ( context.moreParameters() ) {
  5. return getItemsByQuery( context, query );
  6. }
  7. query = new Query( query );
  8. query.setResultsLevel( Level.ALL_PROPERTIES );
  9. query.setLimit( query.getLimit() );
  10. if ( !query.isReversedSet() ) {
  11. query.setReversed( isCollectionReversed( context ) );
  12. }
  13. Results r = em.searchCollection( context.getOwner(), context.getCollectionName(), query );
  14. importEntities( context, r );
  15. for ( Entity entity : r ) {
  16. prepareToDelete( context, entity );
  17. }
  18. for ( Entity entity : r ) {
  19. em.removeFromCollection( context.getOwner(), context.getCollectionName(), entity );
  20. }
  21. return new ServiceResults( this, context, Type.COLLECTION, r, null, null );
  22. }

代码示例来源:origin: apache/usergrid

  1. query.setResultsLevel( level );
  2. query.setLimit( query.getLimit( count ) );

相关文章