stliu,
Thank you very much for the suggestion, finally got it runs in newer versions:
<properties> <spring.version>3.1.1.RELEASE</spring.version> <aspectj.version>1.6.12</aspectj.version> <sloc.version>1</sloc.version> <spring-security.version>3.0.1.RELEASE</spring-security.version> </properties>
However, it stills has problem in querying Postgresql with those @NamedNativeQuery, e.g. Hibernate: select L.* from STORE_LOC L where (? is null or UPPER(L.SUBURB_NM) = UPPER(?)) AND (? is null or UPPER(L.COUNTRY)= UPPER(?)) AND (? is null or UPPER(L.STATE)= UPPER(?)) AND (? is null or UPPER(L.POST_CODE) = UPPER(?)) AND (? is null or L.DIV_ID = ?)AND (? is null or L.ACTIVE_FLAG = ?) AND (? is null or UPPER(L.LOC_NO) = UPPER(?)) AND (? is null or UPPER(L.LOC_NM) LIKE UPPER(?)) AND (? is null or UPPER(L.LOC_TYPE) = UPPER(?)) AND (L.DIV_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) ORDER BY L.LOC_NO ERROR: function upper(bytea) does not exist
If I remove all upper(), it complained: Hibernate: select count(L.LOC_ID) as locCount from STORE_LOC L where (? is null or L.SUBURB_NM = ?) AND (? is null or L.COUNTRY= ?) AND (? is null or L.STATE= ?) AND (? is null or L.POST_CODE = ?) AND (? is null or L.DIV_ID = ?)AND (? is null or L.ACTIVE_FLAG = ?) AND (? is null or L.LOC_NO = ?) AND (? is null or L.LOC_NM LIKE ?) AND (? is null or L.LOC_TYPE = ?) AND (L.DIV_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) ORDER BY L.DIV_ID, L.STATE, L.SUBURB_NM ERROR: operator does not exist: character varying = bytea
Do I need to change the SQL? My plan is to make the application switchable between Oracle and Postgres. Sorry that my knowledge is very limited, so I don't know where the problem is. If you, or someone out there, can give me some suggestion, it would be much appreciated.
|