What I see customers typically doing here is configuring bean properties
rather than hard coding such things in the client bean.
<vendor>
In GemStone/J we generate a properies resource at deployment that contains
all the properities needed for a client to look up the associated bean. That
way the client (or client bean) need only load the associated resource...
Here is a code snippet showing a sample usage of this:
p.load(this.getClass().getResourceAsStream("/EmpServiceAppProperties.txt"));
Context aContext = new InitialContext(p);
String homePath = p.getProperty("HomePath") + "/EmpService";
EmpServiceHome empServiceHome = (EmpServiceHome)
aContext.lookup(homePath);
service = empServiceHome.create();
...
This way the client is blissfully ignorant of the properties detail. It just
needs the resource on the class path (we put it in the client jars).
</vendor>
-Chris.
> -----Original Message-----
> From: Padraic Hannon [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, October 21, 1999 8:00 PM
> To: [EMAIL PROTECTED]
> Subject: help retrieving a beans related entity beans?
>
> I looked through the ejb mailing list archives to no avail, I hope this is
> not a question that has already been covered.
>
> I have two beans: Bean A maps to a db table with two columns id, value.
> And Bean B maps to a table with three columns: id, a_id, value.
>
> I know that Bean B can have a method called getA() which returns
> AHome.findByPrimaryKey(). However, I am unsure as to the best way to get
> AHome.
>
> I know I need to use jndi to lookup AHome, but where can I get the user
> info and url to do so? Do I need to pass this info into every bean? The
> lookup by B for A should have the same user permissions as the initial
> client request for B, but is there a way to get there?
>
> thx
> Padraic Hannon
> MedicaLogic, Inc.
> San Francisco, ca
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".