Hello JOnAS Team,

I have a small problem with GenIC 2.3 generated code, maybe you can help me (maybe it 
is a conceptional error in GenIC 2.3):

I have a table with SQL Type "DATE", which can be read with ResultSet.getDate(int 
columnIndex), what retrieves a java.sql.Date. This works fine.

I want to have an Entity Bean (CMP) that accesses this type. For an entity bean has to 
provide application side logic and not persistence logic, it has an attribute of type 
java.util.Date, since this is the common Date class in java.

Now what GenIC 2.3 does is:

this.createdOn = 
(java.util.Date)MarshallTool.fromBytes((byte[])rs.getBytes("CreatedOn"));

what does not work and from by point of view is a lack to GenIC, since it is clear 
that a mapping from java.util.Date to java.sql.Date is quite common.

Better would be:

this.createdOn = rs.getDate("CreatedOn");

This should be working without problems without any cast, since java.sql.Date is a 
child of java.util.Date.

I can workaround this by making an entity bean with type java.sql.Date, and providing 
a session bean that translates this to java.sql.Date (since all my GUI objects do not 
know of java.sql.Date but only java.util.Date), or is there a possibility to teach 
GenIC to map java.util.Date to java.sql.Date? Since java.sql.Date is a child of 
java.util.Date (so the types are more or less interchangeable), this should not be 
very hard.

I would be glad to see this working in GenIC 2.3.1.

Thank you
Markus

----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to