在ORACLE中
如果不允許改DB設計的話
DB
CREATE TABLE TEST
(
TEST_ID VARCHAR
TEST_CHAR CHAR(
CONSTRAINT TEST_ID PRIMARY KEY (TEST_ID)
);
INSERT INTO TEST VALUES(
測試代碼
Session session = factory
session
List list = session
session
assertTrue(list
輸出結果(ORACLE)
Hibernate:
select
test
test
from
TEST test
where
rtrim(TEST_CHAR)=
而MySQL不會自動補足空格
Hibernate:
select
test
test
from
TEST test
where
rtrim(TEST_CHAR)=
From:http://tw.wingwit.com/Article/program/Oracle/201311/17762.html