我想让用户节点中的 userName 属性唯一。我使用了下面的代码,但它不会在 Neo4j 数据库中创建唯一约束。
@Property(name = "name")
@Index(unique = true)
private String usreName;
Run Code Online (Sandbox Code Playgroud)
仅供参考,我正在使用 Neo4j 服务器版本:3.3.6(社区)和 Spring Boot 2。
但是如果我自己在 Neo4j 浏览器中创建约束,它就可以工作。
CREATE CONSTRAINT ON (user:User) ASSERT user.userName IS UNIQUE
Run Code Online (Sandbox Code Playgroud)
有没有办法强制 Spring Data Neo4J 创建独特的属性,而无需自己在数据库中创建它们?
使用 Quarkus 在执行时出现以下错误:
引起原因:java.lang.IllegalArgumentException:名称“security.jaxrs.deny-unannotated-endpoints”属性的多个匹配属性与公共布尔值io.quarkus.resteasy.reactive.common.runtime.JaxRsSecurityConfig.denyJaxRs和公共布尔值相匹配io.quarkus.resteasy.runtime.JaxRsSecurityConfig.denyJaxRs。这可能是因为您有一个不兼容的扩展组合,它们都定义了相同的属性(例如,包括反应式和阻塞数据库扩展)
我的 pom 属性是:
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>12</maven.compiler.source>
<maven.compiler.target>12</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus-plugin.version>1.13.3.Final</quarkus-plugin.version>
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>1.13.3.Final</quarkus.platform.version>
Run Code Online (Sandbox Code Playgroud)
和依赖项:
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-mutiny</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jsonb</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-mutiny</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-jwt</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-jwt-build</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
我只是尝试使用 Multi from mutiny 和Server Sent Elements进行流式传输:
@GET …
Run Code Online (Sandbox Code Playgroud) 在 jupyter 笔记本中启动 ray 1.2.0 时:
import ray
ray.init(num_cpus = 8)
Run Code Online (Sandbox Code Playgroud)
日志显示仪表板可用于:
2021-02-25 16:21:23,636 INFO services.py:1174 -- View the Ray dashboard at http://127.0.0.1:8265
Run Code Online (Sandbox Code Playgroud)
但我在浏览器中收到“ERR_CONNECTION_REFUSED”。