Discussion:
[Middlegen-user] Re: Custom Finders and Next Release
a***@netcom.no
2002-06-05 06:32:02 UTC
Permalink
Hi Mike,

(cc'ed to middlegen-user since information wants to be free, and
because I liked your first paragraph ;-)

----- Original Message -----
From: Mike Freame <***@hotmail.com>
Date: Wednesday, June 5, 2002 3:23 am
Subject: Custom Finders and Next Release
G'day,
I'm using Middlegen as a cornerstone component of my J2EE
application.. So far I've been very impressed with what it has
been able to do for me.. It's just saved my so much time
managing my entity beans..
:-)))
I have a question about finder methods.. By default,
Middlegen declares finder methods for the primary key, any
foreign keys and all persistent fields.. Like many people, I
want to add some finders of my own, but don't want to modify
the source file generated by Middlegen.. To do this I've
modified the "entity-cmp-20.vm" template file and added the
#set ( $prefix = "finders-" )
#set ( $suffix = ".vm" )
#set ( $file = "$prefix$table.beanName$suffix" )
#include ( $findersFile )
I like this idea!
In theory, for a bean called Company, it will include a file
called "finders-Company.vm" which defines the custom finder
methods for that bean.. The problem I'm having is that
Velocity cannot find the file I've specified.. Do you know
where I should put that file in order for Middlegen/Velocity to
find it? Currently I have it in my classpath but for some
reason it won't find it..
This is a Velocity configuration issue. Velocity looks in a particular
place for include files.
This place can be overridden via the Velocity API I think (or it can be
specified in some properties file).

Honestly I don't know exactly how to do it as I never needed it. If you
find out, please let me know.

Don't hesitate to post a patch to the SF tracker if you do ;-)
The other question I have is when will the next version of
Middlegen be released? I'm currently running off the CVS
head which is making me a little nervous.. I'd much rather
deploy my application into production using a released
version of Middlegen.. Is there anothe release planned soon?
Yup, as soon as possible. It depends on the XDoclet release really.
XDoclet 1.2 beta will hopefully be out in a week or two.
Middlegen 1.1 will be out right after that.
Regards,
Mike..
Have fun,
Aslak

Loading...