IMHO you should put UI level checks in say Struts' action objects and put business rule validations in EJB. I don't think putting validation in dataobject is a good idea, dataobject is tier-less, used in both web and ejb tier where validation requirements are different.
It's been discussed recently in xdoclet-devel. We'll probably provide a simple pre/post setData mechanism. So you'll put @ejb:dataobject pre-method="doPrechecks" in setData and generated setData will call the pre method automatically. For now you can code it yourself by just changing entity-body.j. Ara. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:xdoclet-user- > [EMAIL PROTECTED]] On Behalf Of [EMAIL PROTECTED] > Sent: Friday, February 08, 2002 3:24 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: AW: [Xdoclet-user] Validation code for entity beans / data > objects > > I simply would like to include field validation code in my generated data > objects and the question is how do I achieve it? Can I create a merge file > per entity bean/data object and if so, how would I go about doing that? > > Thanks ! > > Bernie > > -----Ursprungliche Nachricht----- > Von: Konstantin Priblouda [mailto:[EMAIL PROTECTED]] > Gesendet: Freitag, 8. Februar 2002 11:30 > An: Meyer-Willner, Bernhard > Cc: [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Betreff: Re: [Xdoclet-user] Validation code for entity beans / data > objects > > > > > I use XDoclet 1.1.1. to generate EJB 2.0 CMP entity > > beans. I was wondering > > where you folks suggest to put field validation > > logic (preferably the > > generated data objects?) and ideas on how I would go > > about to have my > > validation code included in the generated code. Can > > I use a merge file to > > include validation code specific to different data > > objects and entity beans > > and XDoclet picks the right code fragments for each > > generated DO > > automatically? > > Hi, I'm crossposting this to xdoclet-devel too. > > Maybe we shall borrow some methods from webwork > validation stuff, and made data object "real bean" > with property editors and validator objects? > > And then use reflection somehow? > > > what do you think? > > > regards, > > ===== > Konstantin Priblouda ( ko5tik ) Freelance Software developer > < http://www.pribluda.de > < play java games -> http://www.yook.de > > < render charts online -> http://www.pribluda.de/povray/ > > > __________________________________________________ > Do You Yahoo!? > Send FREE Valentine eCards with Yahoo! Greetings! > http://greetings.yahoo.com > > _______________________________________________ > Xdoclet-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/xdoclet-user _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ Xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
