public Iterator<UUID> idIterator() { List<UUID> l = getIds(); if ( l != null ) { return l.iterator(); } return ( new ArrayList<UUID>( 0 ) ).iterator(); }
@JsonSerialize(include = Inclusion.NON_NULL) public Set<UUID> getIdSet() { if ( idSet != null ) { return idSet; } getIds(); if ( ids != null ) { idSet = new LinkedHashSet<UUID>(); idSet.addAll( ids ); return idSet; } return new LinkedHashSet<UUID>(); }
em.getCollection( entity, collectionName, null, 100000, Level.IDS, false ); List<UUID> entityIds = collectionMembers.getIds();
List<UUID> ids = getIds(); UUID nextResult = null; String cursor = null;
public List<UUID> testEntityCollections( UUID applicationId, UUID entityId, String entityType, String collectionName, int expectedCount ) throws Exception { logger.info( "----------------------------------------------------" ); logger.info( "Checking collection " + collectionName + " for " + entityId.toString() ); EntityManager em = setup.getEmf().getEntityManager( applicationId ); Entity en = em.get( new SimpleEntityRef( entityType, entityId )); int i = 0; Results entities = em.getCollection( en, collectionName, null, 100, Level.IDS, false ); for ( UUID id : entities.getIds() ) { logger.info( ( i++ ) + " " + id.toString() ); } logger.info( "----------------------------------------------------" ); assertEquals( "Expected " + expectedCount + " connections", expectedCount, entities.getIds() != null ? entities.getIds().size() : 0 ); // return connections; return entities.getIds(); }
for ( UUID groupId : r.getIds() ) {
public void distribute( EntityRef group, EntityRef user, Entity activity ) throws Exception { if ( activity == null ) { return; } em.addToCollection( user, "feed", activity ); Results r1 = em.getCollection( group, "users", null, 10000, Level.IDS, false ); if ( ( r1 == null ) || ( r1.isEmpty() ) ) { return; } Results r2 = em.getSourceEntities(new SimpleEntityRef(user.getType(), user.getUuid()), "following", User.ENTITY_TYPE, Level.IDS); if ( ( r2 == null ) || ( r2.isEmpty() ) ) { return; } r1.and( r2 ); List<EntityRef> refs = Results.fromIdList( r1.getIds(), User.ENTITY_TYPE ).getRefs(); if ( refs != null ) { em.addToCollections( refs, "feed", activity ); } } }