id-class

时间:2021-03-15 09:42:24
【文件属性】:
文件名称:id-class
文件大小:61KB
文件格式:ZIP
更新时间:2021-03-15 09:42:24
Java id类 帮助将对象/实体的ID绑定到其类型,从而防止将ID用于错误的对象/实体-并隐式记录与该ID关联的实体类型。 动机 您是否曾经在JPA / Hibernate / JAX-RS或其他框架中混合了包含UUID / String / Long / ... ID的变量? 也许是这样? import java.util.UUID ; class SomeEntity { @Id public UUID id = UUID . randomUUID(); } class OtherEntity { @Id public UUID id; } class Foo { void doStuff ( OtherEntity otherEntity ) { // id gets "transformed" to id of wrong entity: UUID id = othe
【文件预览】:
id-class-main
----pom.xml(11KB)
----id-class-jpa-hibernate-integration()
--------pom.xml(2KB)
--------src()
----id-class-integration-support()
--------pom.xml(705B)
--------src()
----id-class()
--------pom.xml(513B)
--------src()
----mvnw(10KB)
----LICENSE(7KB)
----id-class-jackson-integration()
--------pom.xml(2KB)
--------src()
----.gitignore(274B)
----.mvn()
--------wrapper()
----README.md(5KB)
----mvnw.cmd(6KB)
----lombok.config(269B)

网友评论