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

    public interface VRObjectRepository
    extends org.springframework.data.neo4j.repository.Neo4jRepository<Entity,​Long>, VRSpaceDB
    https://docs.spring.io/spring-data/neo4j/docs/current/reference/html/#neo4j.repositories
    • Field Detail

      • log

        static final org.slf4j.Logger log
    • Method Detail

      • 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})-[r:IN_WORLD]->(w:World) WHERE ID(w)=$worldId RETURN o")
        Set<VRObject> getPermanents​(Long worldId)
      • getClient

        default Client getClient​(Long id)
      • getWorldByName

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

        @Query("MATCH (w:World)<-[i:IN_WORLD]-(o:VRObject)-[r:HAS_POSITION]->(p:Point) WHERE ID(w) = $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,i,w")
        Set<VRObject> getRange​(Long worldId,
                               double x1,
                               double y1,
                               double z1,
                               double x2,
                               double y2,
                               double z2)
      • 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)
      • nullSafeDelete

        default void nullSafeDelete​(Entity e)
      • listWorlds

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

        @Query("MATCH (o:Client)-[i:IN_WORLD]->(w:World) WHERE ID(w) = $worldId RETURN count(*)")
        int countUsers​(long worldId)
      • countUsers

        @Query("MATCH (o:Client)-[i:IN_WORLD]->(w:World) WHERE ID(w) = $worldId AND o.active = $active RETURN count(*)")
        int countUsers​(long worldId,
                       boolean active)