Another option, if you are using Hibernate, is to plug in a custom type in Hibernate that knows what to do. You can take a look at the Hibernate subproject for the Joda-time project for guidance:
http://joda-time.sourceforge.net/contrib/hibernate/index.html Mike 2008/7/7 Matt Raible <[EMAIL PROTECTED]>: > DateUtil is generally used for Date manipulation. This is available to > you if you've full-sourced your project. > > Matt > > On Mon, Jul 7, 2008 at 8:45 AM, pedro_burglin <[EMAIL PROTECTED]> > wrote: > > > > Hi Ali, > > > > If you just want to convert the dates in the Data Access Object layer I > > think you just need to translate from Jalali date to Gregorian in your > > entities' DAO implementation (e.g. CustomerDaoHibernate.java). You may > need > > to implement the methods save to translate from Jalali to Gregorian, and > the > > others (get, getAll, etc) to translate from Gregorian to Jalali. Your > entity > > would have Jalali dates but your database would store Gregorian. > > > > Another option you may want to consider is to implement the translation > in > > your web Actions (the logic that process the web requests). Your entity > and > > database would both have Gregorian dates, and only web forms would use > > Jalali dates. > > > > Hope that helps, > > Pedro Burglin > > > > > > alibehzadian wrote: > >> > >> Hi there, > >> > >> I am developing a Persian-language site with AppFuse Struts 2 Archetype. > >> In web tier, users enter Jalali date but I want to convert these jalali > >> dates > >> to Gregorian date (java.util.Date) before saving them in database. > >> > >> I have the algorithm and libraries to for conversion. Which classes > should > >> I > >> modify in AppFuse? > >> > >> Thanks, > >> Ali Behzadian Nejad. > >> > > > > -- > > View this message in context: > http://www.nabble.com/Convert-Date-attributes-to-JalaliDate-tp18311589s2369p18318468.html > > Sent from the AppFuse - User mailing list archive at Nabble.com. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
