sending date in json object to restful ws
<p>I want to send a date (and other information ) in a json object from android Application to Restful WS </p>

<p>that's what i did in my android App.</p>

<pre><code>        String date =  mFormat.format(Double.valueOf(mYear)) + "-" +  mFormat.format(Double.valueOf(mMonth+1)) + "-" +  mFormat.format(Double.valueOf(mDay)
                );
// so i will have somthing like date = "2016-03-30"

        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd", Locale.FRANCE);
        Date dateFin;
       dateFin= df.parse(date);
       jsonObject.put("datefin", dateFin);
</code></pre>

<p>in Web Service i am using hibernate for ORM with MySql and it work fin inserting the object into DB but the date field always NULL </p>

<p>a snap from the web service </p>

<pre><code>@POST
@Path("/add")
public Response addOffer(Offers offer) throws IOException {
    offerService.addOffer(offer);
    return Response.status(Status.CREATED).entity(offer).build();

}
</code></pre>

<p>and here is the method addOffer.</p>

<pre><code>public void addOffer(Offers offer) {

    // Offers f = new Offers("name","desc","category","market ",longitude,latitude,date);
    Session session = createSessionFactory().openSession();
    Transaction tx = null;
    try {

        tx = session.beginTransaction();
        session.save(offer);
        tx.commit();

    } catch (HibernateException e) {
        if (tx != null)
            tx.rollback();
        e.printStackTrace();
    } finally {
        session.close();
    }

}
</code></pre>

<p>so any ideas why this happening and how to fix it ?? </p>