You can use a converter in TopLink to convert the special date format to a regular date in the object model. The interface your converter should implement is : oracle.toplink.essentials.mappings.converters.Converter
Here is an example of how you would add the converter using a Session Customizer.
[u]Persistence.xml entry:[/u]
[code]
<property name="toplink.session.customizer" value="mypackage.ConverterCustomizer"/>
[/code]
[u]Customizer Class :[/u]
[code]
package mypackage;
import oracle.toplink.essentials.sessions.Session;
import oracle.toplink.essentials.mappings.DirectToFieldMapping;
import oracle.toplink.descriptors.RelationalDescriptor;
/**
* PUBLIC:
* This interface is to allow extra customization on a TopLink Session
*/
public class ConverterCustomizer extends SessionCustomizer {
public void customize(Session session) throws Exception {
RelationalDescriptor descriptor = session.getDescriptor(<class to take converter>);
DirectToFieldMapping mapping = (DirectToFieldMapping)descriptor.getMappingForAttributeName(<mapping to be converted>);
mapping.addConverter(new YourConverter);
}
}
[/code]
[Message sent by forum member 'gyorke' (gyorke)]
http://forums.java.net/jive/thread.jspa?messageID=249067