Package org.vrspace.server.core
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 Summary
Fields Modifier and Type Field Description static org.slf4j.Loggerlog
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default List<WorldStatus>countUsers()intcountUsers(long worldId)intcountUsers(long worldId, boolean active)default voiddelete(VRObject o)default voiddeleteById(Long id)default voiddeleteMembers(Class<?> cls, VRObject obj)default Optional<Entity>findById(Long id)Optional<ContentCategory>findContentCategoryByName(String name)Optional<GltfModel>findGltfModelByUid(String uid)Optional<Ownership>findOwnership(long ownerId, long ownedId)WARNING this doesn't return full, useful owned VRObject - position and other members are missing - use getOwnership insteaddefault ClientgetClient(Long id)<T extends Embedded>
TgetMember(Class<T> cls, Long id)default List<Ownership>getOwned(long ownerId)default OwnershipgetOwnership(long ownerId, long ownedId)List<Ownership>getOwnerships(long clientId)WARNING this doesn't return full, useful owned VRObject - position and other members are missing - use getOwned insteadSet<VRObject>getPermanents(Long worldId)Set<Point>getPoints(double x1, double y1, double z1, double x2, double y2, double z2)default Set<Point>getPoints(Point from, Point to)Set<VRObject>getRange(Long worldId, double x1, double y1, double z1, double x2, double y2, double z2)default Set<VRObject>getRange(Long worldId, Point from, Point to)TerrainPointgetTerrainPoint(Long terrainId, Long index)Set<TerrainPoint>getTerrainPoints(Long terrainId)WorldgetWorldByName(String name)List<World>listWorlds()default voidnullSafeDelete(Entity e)-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, existsById, save
-
Methods inherited from interface org.springframework.data.neo4j.repository.Neo4jRepository
findAll, findAll, findAll, findAll, findAllById, saveAll
-
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
-
Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findOne
-
Methods inherited from interface org.vrspace.server.core.VRSpaceDB
deleteById, findById, get, getClientByName, getClientByName
-
-
-
-
Method Detail
-
deleteById
default void deleteById(Long id)
-
getPermanents
@Query("MATCH (o:VRObject{permanent:true}) WHERE o.worldId=$worldId RETURN o") Set<VRObject> getPermanents(Long worldId)
-
getWorldByName
@Query("MATCH (o:World) WHERE o.name = $name RETURN o") World getWorldByName(String name)
-
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
@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
default void deleteMembers(Class<?> cls, VRObject obj) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
-
nullSafeDelete
default void nullSafeDelete(Entity e)
-
findContentCategoryByName
Optional<ContentCategory> findContentCategoryByName(String name)
-
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
-
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)
-
-