GWT Date Picker Format problem when saving a java date through hibernate in postgresql

Posted by Noor on Stack Overflow See other posts from Stack Overflow or by Noor
Published on 2010-12-29T08:18:51Z Indexed on 2010/12/29 9:53 UTC
Read the original article Hit count: 295

Filed under:
|
|
|
|

Hi, I am using Java Date and Hibernate which is then being saved in the database (Postgresql). I am not that good in hibernate

Part of the Mapping File

<property name="DateOfBirth" type="java.util.Date">
            <column name="DATEOFBIRTH" />
</property>

I am using GWT Date picker Short date format i.e. yyyy-MM-dd. I am getting the value from the date picker using

View.getUserDateOfBirth().getValue()

But when I am saving the date 2010-11-30 into the datebase it is saving it as

2010-11-30 00:00:00

instead of 2010-11-30

So, I want it to be saved in the database as in this format 2010-11-30??

I have many things such timestamp but i not being able to configure it. I think this part

 <property name="DateOfBirth" type="java.util.Date">
                <column name="DATEOFBIRTH" />
    </property>

should be changed but I do not know what to change

© Stack Overflow or respective owner

Related posts about java

Related posts about database