本文整理了Java中org.apache.usergrid.persistence.Query.setResultsLevel
方法的一些代码示例,展示了Query.setResultsLevel
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setResultsLevel
方法的具体详情如下:
包路径:org.apache.usergrid.persistence.Query
类名称:Query
方法名:setResultsLevel
暂无
代码示例来源:origin: apache/usergrid
@Override
public Results getTargetEntities( String connectionType, String connectedEntityType, Level level )
throws Exception {
//until this is refactored properly, we will delegate to a search by query
Results raw = null;
Preconditions.checkNotNull( connectionType, "connectionType cannot be null" );
Query query = new Query();
query.setConnectionType( connectionType );
query.setEntityType( connectedEntityType );
query.setResultsLevel( level );
return searchTargetEntities( query );
}
代码示例来源:origin: apache/usergrid
query.setResultsLevel( Level.ALL_PROPERTIES );
query.setCollection( collectionName );
代码示例来源:origin: apache/usergrid
@Override
public Results getFailedImportEntities(final UUID applicationId, final UUID importId, final UUID fileImportId,
@Nullable final String ql, @Nullable final String cursor) {
Preconditions.checkNotNull(applicationId, "applicationId must be specified");
Preconditions.checkNotNull(importId, "importId must be specified");
Preconditions.checkNotNull(fileImportId, "fileImportId must be specified");
try {
final EntityManager rootEm = emf.getEntityManager(emf.getManagementAppId());
final FileImport importEntity = getFileImport(applicationId, importId, fileImportId);
Query query = Query.fromQLNullSafe(ql);
query.setCursor(cursor);
query.setConnectionType(FileImportTracker.ERRORS_CONNECTION_NAME);
query.setResultsLevel(Level.ALL_PROPERTIES);
//set our entity type
query.setEntityType(Schema.getDefaultSchema().getEntityType(FailedImportEntity.class));
return rootEm.searchTargetEntities(importEntity, query);
} catch (Exception e) {
throw new RuntimeException("Unable to get import entity", e);
}
}
代码示例来源:origin: apache/usergrid
@Override
public Results getFileImports(final UUID applicationId, final UUID importId,
@Nullable final String ql, @Nullable final String cursor) {
Preconditions.checkNotNull(applicationId, "applicationId must be specified");
Preconditions.checkNotNull(importId, "importId must be specified");
try {
final EntityManager rootEm = emf.getEntityManager(emf.getManagementAppId());
final Import importEntity = getImport(applicationId, importId);
Query query = Query.fromQLNullSafe(ql);
query.setCursor(cursor);
query.setConnectionType(IMPORT_FILE_INCLUDES_CONNECTION);
query.setResultsLevel(Level.ALL_PROPERTIES);
//set our entity type
query.setEntityType(Schema.getDefaultSchema().getEntityType(FileImport.class));
return rootEm.searchTargetEntities(importEntity, query);
} catch (Exception e) {
throw new RuntimeException("Unable to get import entity", e);
}
}
代码示例来源:origin: apache/usergrid
query.setResultsLevel(Query.Level.IDS);
devicesQuery.setResultsLevel(Query.Level.CORE_PROPERTIES);
代码示例来源:origin: apache/usergrid
devicesQuery.setResultsLevel(Query.Level.CORE_PROPERTIES);
devicesQuery.setLimit(50); // for now, assume a user has no more than 50 devices
代码示例来源:origin: apache/usergrid
protected Iterator refIterator(EntityManager em, boolean useGraph) throws Exception {
if ( query.getQl() == null && query.getSingleNameOrEmailIdentifier() != null){
return new PagingResultsIterator( getHeadResults( em ), Level.REFS, null);
}
if ( type != null && uuid != null) {
return new PagingResultsIterator( getHeadResults( em ), Level.REFS, null);
}
else {
Query q = query;
if ( query.getResultsLevel() != Level.REFS ) { // ensure REFS level
q = new Query( q );
q.setResultsLevel( Level.REFS );
}
if( useGraph){
return new NotificationGraphIterator( em, source.refIterator( em, true), q );
}else{
return new MultiQueryIterator( em, source.refIterator( em, false ), q );
}
}
}
代码示例来源:origin: apache/usergrid
@Override
public ServiceResults putItemsByQuery( ServiceContext context, Query query ) throws Exception {
checkPermissionsForCollection( context );
if ( context.moreParameters() ) {
return getItemsByQuery( context, query );
}
query = new Query( query );
query.setResultsLevel( Level.ALL_PROPERTIES );
query.setLimit( 1000 );
if ( !query.isReversedSet() ) {
query.setReversed( isCollectionReversed( context ) );
}
Results r = em.searchCollection( context.getOwner(), context.getCollectionName(), query );
if ( r.isEmpty() ) {
throw new ServiceResourceNotFoundException( context );
}
updateEntities( context, r );
return new ServiceResults( this, context, Type.COLLECTION, r, null, null );
}
代码示例来源:origin: apache/usergrid
query.setResultsLevel( level );
代码示例来源:origin: apache/usergrid
@Override
public ServiceResults deleteItemsByQuery( ServiceContext context, Query query ) throws Exception {
checkPermissionsForCollection( context );
if ( context.moreParameters() ) {
return getItemsByQuery( context, query );
}
query = new Query( query );
query.setResultsLevel( Level.ALL_PROPERTIES );
query.setLimit( query.getLimit() );
if ( !query.isReversedSet() ) {
query.setReversed( isCollectionReversed( context ) );
}
Results r = em.searchCollection( context.getOwner(), context.getCollectionName(), query );
importEntities( context, r );
for ( Entity entity : r ) {
prepareToDelete( context, entity );
}
for ( Entity entity : r ) {
em.removeFromCollection( context.getOwner(), context.getCollectionName(), entity );
}
return new ServiceResults( this, context, Type.COLLECTION, r, null, null );
}
代码示例来源:origin: apache/usergrid
query.setResultsLevel( level );
query.setLimit( query.getLimit( count ) );
内容来源于网络,如有侵权,请联系作者删除!