public MultiQueryIterator( EntityManager entityManager, Iterator<EntityRef> source, Query query ) { if ( query.getCollection() == null && query.getConnectionType() == null ) { throw new IllegalArgumentException( "Query must have a collection or connectionType value" ); } this.entityManager = entityManager; this.source = source; this.query = query; }
/** * chained * * @param source the source query we're chaining from * @param query the query - must have a collection or connectType value set */ public PathQuery( PathQuery source, Query query ) { if ( query.getCollection() == null && query.getConnectionType() == null ) { throw new IllegalArgumentException( "Query must have a collection or connectionType value" ); } this.source = source; this.query = query; }
/** * top level * @param head the top-level entity * @param query the query - must have a collection or connectType value set */ public PathQuery(EntityRef head, Query query) { if ( query.getCollection() == null && query.getConnectionType() == null ) { throw new IllegalArgumentException( "Query must have a collection or connectionType value" ); } this.uuid = head.getUuid(); this.type = head.getType(); this.query = query; }
private Results getResultsFor( EntityRef ref ) { entityRef.setUUID(ref.getUuid()); entityRef.setType(ref.getType()); try { return ( query.getCollection() != null ) ? entityManager.searchCollection( entityRef, query.getCollection(), query ) : entityManager.searchTargetEntities(entityRef, query); } catch ( Exception e ) { throw new RuntimeException( e ); } }
uuid.toString(), query.getCollection(), entityUUID.toString()); String entityType = InflectionUtils.singularize(query.getCollection()); uuid.toString(), query.getCollection(), name); String entityType = InflectionUtils.singularize(query.getCollection()); uuid.toString(), query.getCollection(), query.getQl().isPresent() ? query.getQl().get() : "NONE"); return ( query.getCollection() != null ) ? em.searchCollection( ref, query.getCollection(), query ) : em.searchTargetEntities(ref, query);
if (query.getCollection() != null) { ref.getType(), query.getCollection()); devicesQuery.setResultsLevel(Query.Level.CORE_PROPERTIES); return entityManager.searchCollection(ref, devicesQuery.getCollection(), devicesQuery); return entityManager.searchCollection(ref, query.getCollection(), query); ref.getType(), query.getCollection());
entities = em.searchCollection(new SimpleEntityRef("user", ref.getUuid()), devicesQuery.getCollection(), devicesQuery).getEntities();