Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 64254 invoked from network); 2 Feb 2011 20:37:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Feb 2011 20:37:45 -0000 Received: (qmail 14849 invoked by uid 500); 2 Feb 2011 20:37:45 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 14783 invoked by uid 500); 2 Feb 2011 20:37:44 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 14775 invoked by uid 99); 2 Feb 2011 20:37:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 20:37:44 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=FREEMAIL_FROM,RFC_ABUSE_POST,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [121.101.151.141] (HELO web137314.mail.in.yahoo.com) (121.101.151.141) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 02 Feb 2011 20:37:37 +0000 Received: (qmail 58425 invoked by uid 60001); 2 Feb 2011 20:37:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s1024; t=1296679034; bh=hRQDfFYVIhOufbhB2i0Pm/3tNvQSakNUpKTvy7TDKrk=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=VtyYckbEAUKuXuGi9knKo/sey01VzD4QdmFBYxQiWEhvAJoKgWT3kx5VXWm2euidUG4JIDJEjFTi/YfphDLO5BbNO60O7sDAukqJEs3Cg8HYWxBdJtcCn8lXQnF3qr0qi3Sr7g+A+PSXg+FsMdoO38OF85iUacJtAmtvqocGaS8= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=iYcP4hJTH3NyJKPaUDlUoorv6L9uMpXo2zJ5I2bJ9fh8B8XU6bTOxlGbmnL/Zc5chWG2soqb1caO1L7lvEmV0eYpG2/Cjs2JluLMEiAhNlr29GFMPOrHA5Plt6zTuiJa/oR5494S08Nyb8e7JwU6x/bBcMqqsDlBZlZCcuCh8WI=; Message-ID: <775880.56593.qm@web137314.mail.in.yahoo.com> X-YMail-OSG: _G7NK.MVM1md0bj8IfTQvKd3P6C4Tdyiz.VKs_z2z2r2eFr Kfhr5N.Z7513xJlgS5bTR3olB1rF2TxGp1UKu1L6q3.h2F8nN8e9oPBEEyYO I5mJeOJX8OOvMxhYQuny03ZGyYHQE580kYRxp.jA0dVwjyyJ49QMvnmnRlBA 1FiLmo.WMIMWeGkTMqk0dM9EPspA94WTcaTMXNgsOm.gl0lxGYXgC_r_jkjp bm3tb0e42NUF.hZTH2sbDjP.7Yc.liZJnwapszCZK8lVAERuEiv7EP0RaQXg - Received: from [12.13.141.101] by web137314.mail.in.yahoo.com via HTTP; Thu, 03 Feb 2011 02:07:14 IST X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.108.291010 Date: Thu, 3 Feb 2011 02:07:14 +0530 (IST) From: ram Subject: persisting object of perticular date format To: users@openjpa.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I have a date in string format =0A =0A format yyyy-MM-dd'T'HH:mm:ss.=0A = e.g.2010-12-25T12:00:00=0A=0AI created entity from the tables . Here is m= y employee entity.=0A=0AClass Emp{=0A String id,=0A java.sql.date joinDat= e=0A}=0A=0A As i see to_date() is not applicable in JPA, How can i persist= the joined date in the same format 2010-12-25T12:00:00 into the database b= y using jpa. =0A=0AHow can i specify this format yyyy-MM-dd'T'HH:mm:ss.=0A= =0A Later on i want to search the emp who has joined in the format (yyyy-= mm-dd) 2010-12-25, so that i can get all the values from the database=0A201= 0-12-25T12:00:00=0A2010-12-25T11:00:00=0A2010-12-25T10:05:00=0A=0A@NamedQue= ry(name=3D"getEmployeeByDate",query=3D"select p from Emp p where p.joinDate= =3D? ")=0A=0A=0A=0AThanks,=0ARam=0A=0A