Interface VRObjectRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Entity,Long>, org.springframework.data.neo4j.repository.Neo4jRepository<Entity,Long>, org.springframework.data.repository.PagingAndSortingRepository<Entity,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Entity>, org.springframework.data.repository.Repository<Entity,Long>, VRSpaceDB

@DependsOn("database") public interface VRObjectRepository extends org.springframework.data.neo4j.repository.Neo4jRepository<Entity,Long>, VRSpaceDB
  • Field Details

    • log

      static final org.slf4j.Logger log
  • Method Details

    • findById

      default Optional<Entity> findById(Long id)
      Specified by:
      findById in interface org.springframework.data.repository.CrudRepository<Entity,Long>
    • deleteById

      default void deleteById(Long id)
      Specified by:
      deleteById in interface org.springframework.data.repository.CrudRepository<Entity,Long>
    • getPermanents

      @Query("MATCH (o:VRObject{permanent:true}) WHERE o.worldId=$worldId RETURN o") Set<VRObject> getPermanents(Long worldId)
    • getClient

      default Client getClient(Long id)
    • getAllInWorld

      @Query("MATCH (o:VRObject) WHERE o.worldId = $worldId RETURN o") Set<VRObject> getAllInWorld(Long worldId)
    • deleteWorld

      default void deleteWorld(World world)
    • getWorldByName

      @Query("MATCH (o:World) WHERE o.name = $name RETURN o") World getWorldByName(String name)
    • getRange

      default Set<VRObject> getRange(Long worldId, Point from, Point to)
    • getRange

      @Query("MATCH (o:VRObject)-[r:HAS_POSITION]->(p:Point) WHERE o.worldId = $worldId AND p.x >= $x1 AND p.y >= $y1 AND p.z >= $z1 AND p.x <= $x2 AND p.y <= $y2 AND p.z <= $z2 RETURN o,r,p") Set<VRObject> getRange(Long worldId, double x1, double y1, double z1, double x2, double y2, double z2)
    • getPoints

      default Set<Point> getPoints(Point from, Point to)
    • getPoints

      @Query("MATCH (p:Point) WHERE p.x >= $x1 AND p.y >= $y1 AND p.z >= $z1 AND p.x <= $x2 AND p.y <= $y2 AND p.z <= $z2 RETURN p") Set<Point> getPoints(double x1, double y1, double z1, double x2, double y2, double z2)
    • getMember

      @Query("MATCH (o:Entity) WHERE ID(o) = $id RETURN o") <T extends Embedded> T getMember(Class<T> cls, Long id)
    • delete

      default void delete(VRObject o)
    • deleteMembers

      Throws:
      NoSuchMethodException
      SecurityException
      IllegalAccessException
      IllegalArgumentException
      InvocationTargetException
    • nullSafeDelete

      default void nullSafeDelete(Entity e)
    • findGltfModelByUid

      Optional<GltfModel> findGltfModelByUid(String uid)
    • findContentCategoryByName

      Optional<ContentCategory> findContentCategoryByName(String name)
    • listWorlds

      @Query("MATCH (o:World) RETURN o") List<World> listWorlds()
    • countUsers

      @Query("MATCH (o:Client) WHERE o.worldId = $worldId RETURN count(*)") int countUsers(long worldId)
    • countUsers

      @Query("MATCH (o:Client) WHERE o.worldId = $worldId AND o.active = $active RETURN count(*)") int countUsers(long worldId, boolean active)
    • countUsers

      default List<WorldStatus> countUsers()
    • getOwnerships

      @Query("MATCH (obj:VRObject)<-[owned:IS_OWNED]-(o:Ownership)-[owns:IS_OWNER]->(c:Client) WHERE ID(c) = $clientId RETURN o,owns,c,owned,obj") List<Ownership> getOwnerships(long clientId)
      WARNING this doesn't return full, useful owned VRObject - position and other members are missing - use getOwned instead
      Parameters:
      clientId -
      Returns:
      list of all ownerships
    • getOwned

      default List<Ownership> getOwned(long ownerId)
    • getOwnersOf

      @Query("MATCH (obj:VRObject)<-[owned:IS_OWNED]-(o:Ownership)-[owns:IS_OWNER]->(c:Client) WHERE ID(obj) = $objectId RETURN o,owns,c,owned,obj") List<Ownership> getOwnersOf(long objectId)
      WARNING this doesn't return full, useful owned VRObject - position and other members are missing - use getOwners instead
      Parameters:
      objectIdId -
      Returns:
      list of all owners
    • getOwners

      default List<Ownership> getOwners(long objectId)
    • findOwnership

      @Query("MATCH (obj:VRObject)<-[owned:IS_OWNED]-(o:Ownership)-[owns:IS_OWNER]->(c:Client) WHERE ID(c) = $ownerId AND ID(obj) = $ownedId RETURN o,owns,c,owned,obj") Optional<Ownership> findOwnership(long ownerId, long ownedId)
      WARNING this doesn't return full, useful owned VRObject - position and other members are missing - use getOwnership instead
    • getOwnership

      default Ownership getOwnership(long ownerId, long ownedId)
    • getTerrainPoints

      @Query("MATCH (tp:TerrainPoint)-[r:IS_POINT_OF]->(t:Terrain) WHERE ID(t)=$terrainId RETURN tp") Set<TerrainPoint> getTerrainPoints(Long terrainId)
    • getTerrainPoint

      @Query("MATCH (tp:TerrainPoint)-[r:IS_POINT_OF]->(t:Terrain) WHERE ID(t)=$terrainId and tp.index=$index RETURN tp") TerrainPoint getTerrainPoint(Long terrainId, Long index)