在我当前的实现中,我为每个db表都有单独的实体类.我正在使用JPA和eclipselink-2.5.2.这对我来说很好,但在某些时候,当数据很大时,它会滞后.这就是我决定开始使用@ Embedded,@ Embeddable和@EmbeddedId的原因.在这样做时,我收到的错误对我来说非常奇怪.这是完整的堆栈跟踪:https://gist.githubusercontent.com/tjDudhatra/b955812e0d1a71cf97f1/raw/11ea458869e24baae744530417ac99bc877ed514/gistfile1.txt
具体,让我给你一个确切的场景,在这种情况下,我得到了例外.考虑这个有三个类的Code块.一个注释为@Entity,其他两个注释为@Embeddable.我知道在一个类中我们不能定义@Id和@EmbeddedId而我没有这样做,那么在部署服务器时,我得到的异常只表示:
[class org.apache.{SomeClass}]同时包含@EmbdeddedId(在属性[id]上)和@Id(在属性[]上.两种ID类型都不能在同一实体上指定.
@Entity
@Table(name="user")
public class User {
@ID
public Long id;
@Column(name="userCode")
public String userCode;
@ElementCollection
@CollectionTable(name = "address", joinColumns = @JoinColumn(name = "user_id"))
public List<Address> addressList;
....
}
@Embeddable
public class Address {
@EmbeddedId
@Column(name = "id")
public Long id;
@Column(name="userId")
public Long userId;
@Column(name="address-line-1")
public String addressLine1;
@Column(name="address-line-2")
public String addressLine2;
@ElementCollection
@CollectionTable(name = "phone", joinColumns = @JoinColumn(name = "user_id"))
protected List<Phone> phoneList;
....
}
@Embeddable
public class Phone { …Run Code Online (Sandbox Code Playgroud) 我有一个实用程序服务 x,它在 Maven 仓库中,并被我的其他一些服务使用。我们通常会在进行小的更改时更新服务 x 的次要版本,目前我们的版本是 1.0.15。不,我正在做另一项更改,我在考虑是应该将版本更新到 1.0.16,还是应该将版本更新为 1.1.0。如果有人可以解释一般应该如何做到这一点,那我肯定会帮助其他开发人员以及我。如果您需要更多信息,请告诉我。
version-control pom.xml maven microservices maven-versions-plugin