Skip to content

Date problem #29

@GoogleCodeExporter

Description

@GoogleCodeExporter
Hi. I use this lib with JPA 2, and 
@Entity
...
    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private Date createdDate;
getDate(); - return normal value

but setDate(new Date()); write null to db 
setDate(new Date(System.currentTimeMillis())); write ~o_O to db 
and getDate(); after write to db not work, need manually look to db with some 
programs and remove broken record... then work getDate(); again;
and if write setDate(new Date(System.currentTimeMillis())); then change from 
Date to String getDate(); private String createdDate; - returned value 
1233565546 currentTimeMillis - and another normal data dates like "2012-10-10 
10:10:10" 

in db
CREATE TABLE comingsofinvoicesongoods (
  id              integer PRIMARY KEY AUTOINCREMENT NOT NULL,
  "date"          datetime DEFAULT CURRENT_TIMESTAMP,
  invoiceid       varchar(80),
  counterpartyid  integer,
  storehouse      integer,
  info            text
);

Original issue reported on code.google.com by sp.titan on 13 Jul 2012 at 11:29

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions