Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356416

Summary: Generic ODA driver (and tooling) developed in bug 330988, does not work with java.util.Date types
Product: [Modeling] EMF Reporter: John Conlon <jconlon>
Component: CoreAssignee: Kenn Hussey <Kenn.Hussey>
Status: VERIFIED FIXED QA Contact: Kenn Hussey <Kenn.Hussey>
Severity: normal    
Priority: P3 Flags: Kenn.Hussey: indigo+
Version: unspecified   
Target Milestone: SR1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Checks for date types and converts java.util.Date to java.sql.Date none

Description John Conlon CLA 2011-08-31 17:28:34 EDT
Build Identifier: 20110615-0604

If an ECore model contains java.util.Date types, the ODA driver throws java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date
	at org.eclipse.emf.oda.ecore.impl.ResultSet.getDate(ResultSet.java:398)

Reproducible: Always

Steps to Reproduce:
1. Create a ECore model and instance that contains java.util.Date types
2. Use model instance as ECore DataSource and create a New ECore DataSet with query to return a column(s) with the Date type.
3. From the DataSet Editor Preview Results
Comment 1 John Conlon CLA 2011-08-31 17:34:48 EDT
Created attachment 202570 [details]
Checks for date types and converts java.util.Date to java.sql.Date

This patch seems to fix it for me.
Comment 2 Kenn Hussey CLA 2011-08-31 22:18:57 EDT
The fix has been committed to CVS (head and maintenance). Builds will be made available early next week.
Comment 3 Kenn Hussey CLA 2011-09-05 10:15:57 EDT
Builds containing this fix are now available at http://www.eclipse.org/modeling/emf/downloads/?project=emf and in the following update sites:

HEAD (2.8.0)
http://download.eclipse.org/modeling/emf/emf/updates/2.8-I-builds/

Maintenance (2.7.1)
http://download.eclipse.org/modeling/emf/emf/updates/2.7.x/
Comment 4 John Conlon CLA 2011-09-05 18:33:28 EDT
(In reply to comment #3)
> Builds containing this fix are now available at
> http://www.eclipse.org/modeling/emf/downloads/?project=emf 

Don't find the oda features in the M201109050916 (2011/09/05) 2.7.x Maintenance Build, where I would have expected it to be.

> and in the following
> update sites:
> 
> HEAD (2.8.0)
> http://download.eclipse.org/modeling/emf/emf/updates/2.8-I-builds/
> 
> Maintenance (2.7.1)
> http://download.eclipse.org/modeling/emf/emf/updates/2.7.x/

But do see it is in the 2.7.1 Maintenance update site.
Comment 5 Kenn Hussey CLA 2011-09-05 20:17:53 EDT
(In reply to comment #4)
> Don't find the oda features in the M201109050916 (2011/09/05) 2.7.x Maintenance
> Build, where I would have expected it to be.

Sorry, you're right, the ODA SDK isn't currently included in the legacy downloads, other than as part of the "all-in-one update site" archive, from which you could install the features locally if you wanted. The expectation is that consumers should be transitioning to the (hosted) update site if they haven't already...