0
我的代碼是: -想前置自動生成利用用戶提供的字符串,JPA Id值或休眠
@Id
//@SequenceGenerator(name = "non_distributor", sequenceName="nd")
@GeneratedValue
public int getNondistid()
{
return nondistid;
}
public void setNondistid(int nondistid)
{
this.nondistid = nondistid;
}
它是在數字生成的值id爲1,2,3,但我想,自動生成的ID必須如下所示: - 「nd_01」或「nd1」。 所以請提供建議如何使用註釋生成相同的內容。
試過,但不產生價值所需的ID ...我要創造價值ID爲「ND_1」假設爲nondistributor ID – 2012-08-14 07:09:06