Community
Participate
Working Groups
Starting from the table below: CREATE TABLE SECONDARY ( EMPNO NUMERIC(4), ENAME VARCHAR(10), JOB VARCHAR(9), MGR NUMERIC(4), HIREDATE DATE, SAL DECIMAL(7,2), COMM DECIMAL(7,2), DEPTNO NUMERIC(2), PRIMARY KEY (EMPNO) ) build a CustomSQL operation with 'build' SQL: <?xml version="1.0" encoding="UTF-8"?> <dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <properties> <property name="projectName">@PROJECT@</property> <property name="logLevel">@LOG_LEVEL@</property> <property name="username">@DB_USER@</property> <property name="password">@DB_PASSWORD@</property> <property name="url">@DB_URL@</property> <property name="driver">@DB_DRIVER@</property> <property name="platformClassname">@DB_PLATFORM@</property> <property name="dataSource">@DATASOURCE@</property> <property name="wsdlLocationURI">@WSDL_LOCATION@</property> </properties> <sql name="allSecondary" isCollection="true" > <statement>select * from SECONDARY</statement> <build-statement>select * from SECONDARY where 0=1</build-statement> </dbws-builder> When DBWSBuilder get the JDBC metadata for the ResultSet of running 'select * from SECONDARY where 0=1', the jdbc type code for HIREDATE is 93 (TIMESTAMP), not 91
This is a known problem with Oracle JDBC metadata. Previous to 11gR1, setting the system properties: -Doracle.jdbc.V8Compatible=true and -Doracle.jdbc.mapDateToTimeStamp=false solved the problem. Unfortunately, these settings no longer work. Temporary hack in BaseDBWSBuilderHelper>>buildORFieldMappingFromColumn (and buildOXFieldMappingFromColumn) else { attributeClass = getClassFromJDBCType(dmdTypeName.toUpperCase(), databasePlatform); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=359130 //problem with conversion and Oracle11 platform if (attributeClass.getName().contains("oracle.sql.TIMESTAMP")) { attributeClass = java.sql.Timestamp.class; }
Closing since there isn't any other way to solve this other than the 'hack' refered to in code
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink