openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Drew Lethbridge <d...@bund.com.au>
Subject Re: java.util.Data mapping to abstime (deprecated) in postgres
Date Fri, 02 May 2008 05:33:38 GMT
No worries mate.  You don't need to modify openjpa (in this case),  
it's designed to allow you to plug in your own classes, which live  
inside your own jar files, by specifying your plug-ins in the  
properties.  Other than my DBDictionaries (I have plugged in separate  
DBDic for Oracle, Postgres, etc.) I have some other classes plugged in  
to kodo.FilterListeners and kodo.AggregateListeners and so on...  So  
far I haven't needed to modify the openjpa distribution.  Anyway, good  
luck with it.

cheers!

.droo.

On 02/05/2008, at 2:52 PM, Yazbek, Daniel (Daniel) wrote:

> Hi Drew, thanks for your suggestion, I had thought of that but didn't
> want to go modifying weblogic's distribution of openjpa.
>
>
>
>
>> -----Original Message-----
>> From: Drew Lethbridge [mailto:droo@bund.com.au]
>> Sent: Friday 2 May 2008 14:13
>> To: users@openjpa.apache.org
>> Subject: Re: java.util.Data mapping to abstime (deprecated) in
> postgres
>>
>> Hi Daniel.  I also had your problem and fixed it by implementing my
>> own DBDictionary (subclass of PostgresDictionary) and plugging it in
>> using the kodo.jdbc.DBDictionary configuration setting...  Below is  
>> an
>> sample of my dbdictionary which might be helpful...
>>
>> cheers!
>>
>> .droo.
>>
>> public class MyPostgresDictionary extends PostgresDictionary
>> {
>>     private static final String TIMESTAMPTYPENAME = "timestamp";
>>
>>     /**
>>      * return the Database type for the given Java type.
>>      * When using postgres 8, map java.util.Date type to postgres
>> TIMESTAMP column type,
>>      * instead of the Kodo PostgresDictionary default, which is
>> ABSTIME.  ABSTIME cannot
>>      * represent dates beyond 19/01/2038.  if the type parameter does
>> not specify a a Date,
>>      * then the default PostgresDictionary behaviour applies.
>>      */
>>     @Override
>>     public String getTypeName(int type)
>>     {
>>         if (type == Types.TIMESTAMP)
>>         {
>>             return TIMESTAMPTYPENAME;
>>         }
>>         else
>>         {
>>             return super.getTypeName(type);
>>         }
>>     }
>>
>> //...
>>
>> }
>>
>> On 02/05/2008, at 1:56 PM, Yazbek, Daniel (Daniel) wrote:
>>
>>> Hi all,
>>>
>>>
>>>
>>> I am using BEA Weblogic 10, which implements persistence by using
> kodo
>>> and openjpa.
>>>
>>> I have set this up to persist to a Postgres 8.3 Database.
>>>
>>> I have a java.util.Date that I want as a column in a table.
>>>
>>> When I run the mapping tool, it maps the java.util.Data datatype to
>>> Postgres datatype "abstime". However, this datatype is deprecated,
> and
>>> should be mapping to "timestamp without time zone" instead.
>>>
>>> Has anyone had any success in mapping this properly?
>>>
>>> Perhaps I should raise a bug against openjpa?
>>>
>>> Thanks
>>>
>>> | Daniel Yazbek | Avaya Labs Australia | 123 Epping Road | North
> Ryde
>>> 2113 | Australia | +61-2-9352-8615 | dyazbek@avaya.com
>>> <mailto:dyazbek@avaya.com>  |
>
>


Mime
View raw message