开发者

Proper Oracle data type for Java Object

I am using Hibernate, and I wan开发者_运维百科t one of my column to be mapped into Java Object, something like so..

@Column(name="SPECIAL_COLUMN")
public Object getSpecialColumn() {
    ....
}

The Object could be Integer, BigDecimal, String, or Date. How do I map this to Oracle?


Since Integer, BigDecimal, Date, and String all implements Serializable, I ended up using Serializable in Java and BLOB in Oracle.., like so..

@Column(name="SPECIAL_COLUMN")
public Serializable getSpecialColumn() {
    ....
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜