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() {
....
}
精彩评论