Hello,
First of all, thanks to Jim for his many answers on the
jonas mailing lists.
I take the liberty to complete this following answer.
Best regards.
H�l�ne.
Jim Richards wrote:
>
> At 06:31 PM 24/10/99 -0400, [EMAIL PROTECTED] wrote:
> >Q1) For JOnAs we define all Find methods in a
> > property file & all the examples I've seen
> > so far are when the database coloumn is int/number.
> > I wonder how you define these Find(s)(in property
> > file) in case you've VarChar in a where clause?
>
> You'll need to define that youu have a primary key class
> in both your properties file and your deployment descriptor.
>
> In your properties file you'll have something like
>
> ...
>
> db.Field.id id
> db.Field.clientId client_id
> db.Field.franchiseeId franchisee_id
>
> ...
>
> db.Finder.findByPrimaryKey where id = ? and client_id = ? and
>franchisee_id = ?
>
> my id, client_id and franchisee_id here are all char's, although varchar will
> work as well without problems ...
findByPrimaryKey is a particular finder method which not needs
to specify the "where clause" in the deployment descriptor.
Indeed, the container tool (GenIC) is able to generate the
implementation of this method by:
- using the reflection API of the Java langage,
and the Primary Key class,
- using the mapping of the bean fields to the
underlying database (which table, which column),
defined in the deployement descriptor.
The fields, which must appear in the where clause, are
the fields of the primary key class.
>
> >Q2) In my example program I've only one default Find
> > method i.e. findByPrimaryKey & my understanding
> > was that this default Find does not need any
> > defination in property file. Is that a correct
> > statement? Now, when I debug my client &
> > call (code snippet):
> >
> > interface_eventsPK pk = new interface_eventsPK();
> > pk.interface_eventsId = 1000;
> > interface_events iface = null;
> > iface = (interface_events)home.findByPrimaryKey(pk);
> >
> > As soon I call findByPrmaryKey, I get an
> > exception, as follows:
> >
> > "Unexpected Error java.rmi.ServerError: Server
> > Error; nested exception is:
> > java.lang.IncompatibleClassChangeError:
> > Unimplemented interface method"
>
> Not sure, if you're using container managed persistence then you'll
> only need to define what you want and GenIC will create the
> find* methods for you.
It's right, GenIC uses the information given in the deployement
descriptor to be able to generate the implementation of the finder
methods.
>
> > I checked my bean with CheckEJB utility - no problem.
> > I tried defining findByPrimaryKey in property file -
> > same results?
> > Please help me with this as I'm out of wits...
>
> Yeah, CheckEJB isn't perfect, but better then nothing ...
>
> >Q3) How do you pronouce "JOnAs" - I mean what does it
> > mean..
>
> Um, something like joe-nas, I keep thinking it's a variant on
> Jonah, the whale fodder from the old testament ...
>
> --
> Subvert the dominant paradigm
> http://www.cyber4.org/members/grumpy/index.html
--
-=- H�l�ne JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
mailto:[EMAIL PROTECTED] http://www-frec.bull.com
Phone: 33.4.76.29.73.53 Fax: 33.4.76.29.76.00
Download our EJB Server JOnAS at http://www.bullsoft.com/ejb
_______________________________________________________________