0

hibernate を使用して jsp ページに値を表示しています。私はオラクルデータベースを持っています。ただし、テーブル .so のどの列にも値がない場合、jsp に表示すると null として表示されます。null を削除して、その代わりに "" を配置したかったのです。休止状態から何かをする必要がありますか?

4

2 に答える 2

1

Hibernate have something like Custom User Type

Here you have an example of getting name of enumeration an transform this name to enum: https://community.jboss.org/wiki/UserTypeForPersistingATypesafeEnumerationWithAVARCHARColumn

It's very easy to change this example to work with strings.

于 2012-08-25T18:46:20.727 に答える
0

値を !=null と比較してから空を割り当てます。すなわち。

      String value = value !=null ? value : "";
于 2012-08-25T16:39:53.723 に答える