You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by 张峰昌 <al...@gmail.com> on 2013/05/07 02:16:43 UTC

答复: org.apache.isis.applib.value.Date Or DateTime in JDO with postgres database

Hi Jeroen and Dan:

Thank you for your help. Joda types works well in my case.

Best Regards

Alain

-----邮件原件-----
发件人: Dan Haywood [mailto:dan@haywood-associates.co.uk] 
发送时间: 2013年5月6日 22:35
收件人: users
主题: Re: org.apache.isis.applib.value.Date Or DateTime in JDO with postgres
database

The bytea is a byte array, which is the default way that JDO/DN stores
serializable objects.  I'm guessing that the IsisDateMapping isn't
configured correctly, for some reason.

But, as Jeroen says, I suggest you go with the Joda types.

And I've been wondering if we should have a vote on whether to deprecate
Isis' own Date and DateTime classes.  They don't offer anything over and
above what Joda gives us.  And when Java8 comes out, we can look forward to
javax.time and all this as part of the JDK.

Dan





On 6 May 2013 12:32, Jeroen van der Wal <je...@stromboli.it> wrote:

> Hi Alain,
>
> Looking at the IsisDateMapping it should store as a Long in in the 
> database so I don't know why you get the bytea.
>
> In our current project we moved away from the applib Data/Time classes 
> and now use the excellent Joda types. This is supported natively by 
> Datanucleus.
>
> If you want to further investigate the custom type mapping perhaps the 
> Datanucleus documentation [1] is a good start.
>
> Cheers,
>
> Jeroen
>
> [1] http://www.datanucleus.org/extensions/rdbms_java_types.html
>
>
>
>
> On Mon, May 6, 2013 at 12:37 PM, 张峰昌 <al...@gmail.com> wrote:
>
> > Hi Dan:
> >
> >
> >
> > What’s the default data type will be used when model a filed with 
> > type
> org.
> > apache.isis.applib.value.Date Or DateTime in JDO dataobject store?
> >
> > I have found that “bytea” will be used in Postgres Database with JDO 
> > object store.I needs date or datetime datatype in postgres 
> > databse,can
> you
> > help me to correct the problem?
> >
> >
> >
> > A sample mode property:
> >
> >     // {{ FromDate (property)
> >
> >     private DateTime fromDate;
> >
> >
> >
> >     @MemberOrder(sequence = "3")
> >
> >     @Named("开始时间")
> >
> >     @Persistent
> >
> >     public DateTime getFromDate() {
> >
> >         return fromDate;
> >
> >     }
> >
> >
> >
> >     public void setFromDate(final DateTime fromDate) {
> >
> >         this.fromDate = fromDate;
> >
> >     }
> >
> >     // }}
> >
> >
> >
> > Best Regards
> >
> >
> >
> > Alain
> >
> >
> >
> >
>