我看过以下问题
使用Spring Data REST而不是Spring Data JPA有什么好处?
它不能满足我的需求.我的DB在MYSQL上,我选择了Spring-Data-JPA实现.REST可以给我带来的所有附加优势是什么?我在简单的Spring-Data-JPA中找不到这些优点?例如,如果明天,我决定实现一个缓存b/w我的业务和数据库模块,在这种情况下,我必须编写较少的代码?哪个很容易配置?哪个会更灵活,怎么样?
另外,如果我在新应用程序中同时使用REST和JPA,我会破坏哪些设计原则?
我期待从架构的角度来看答案.提前致谢.
目前我正在为Spring Data Rest开发POC.试图获得存储库的可用JSONout.
我有一个实体类(NewTask)
@Entity
@Table(name="newtable")
public class NewTask {
@Id
@Column(name="newid")
private int id;
@Column(name="newage")
private int age;
@Column(name="newaddress")
private String address;
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
Run Code Online (Sandbox Code Playgroud)
和相应的存储库..
@RepositoryRestResource
@PreAuthorize("hasRole('ROLE_ADMIN')")
public interface NewTaskRepository extends CrudRepository<NewTask, …Run Code Online (Sandbox Code Playgroud) 我们如何在android studio中检查元素.
eclipse对应物是Ctrl+Shift+I(选择变量或表达式后,按Ctrl+Shift+I).在互联网上找不到这个,请帮忙!
我和杰克逊有一个Spring Boot项目。
每当我启动它时,都会遇到此异常(仅适用于生产环境)。
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/apps/upiswitchv2/lib/upiswitchv2.jar!/BOOT-INF/lib/log4j-slf4j-impl-2.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/apps/upiswitchv2/lib/upiswitchv2.jar!/BOOT-INF/lib/slf4j-nop-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/apps/upiswitchv2/lib/upiswitchv2.jar!/BOOT-INF/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method …Run Code Online (Sandbox Code Playgroud)