Hi Mark,
this is something that RIFE doesn't do automatically yet, but it's
scheduled in the issue tracker. The main issue is the design of how
it would work without dragging performance down. Ideally this should
be lazy-loading, but that's only possible through byte-code
modification I think of the appropriate getters / setters. These
would then execute the query when the object is asked for. Another
difficulty would be that each bean instance that is retrieved from
the DB would then have to recall which datasource is was obtained from.
Don't fred though, you can achieve something similar today already by
implementing the afterRestore method of a CallBack:
http://rifers.org/docs/api/com/uwyn/rife/database/querymanagers/
generic/Callbacks.html#afterRestore(BeanType)
http://rifers.org/wiki/display/RIFE/Callbacks
Hope this helps.
Best regards,
Geert
On 12 Apr 2006, at 04:47, Mark Ashworth wrote:
Good Day,
Thank you very much for the help earlier, the
ConstainedProperty#manyToOne()
validation works like a dream. I was wondering if it was possible
to load a
property like location onto a bean like position given the
following database
structure.
Position (Table) Location (Table)
---------------- ----------------
id (PK) id (PK)
location_id (FK) description
public class Position {
...
private Location location;
...
public void setLocation(final Location value) {this.location =
value;}
public Location getLocation() {return this.location;}
}
The question is how to populate the Location property on the
Position class
when it is loaded from the database?
Mark P Ashworth
Fax: 086 686 1624
Cell: 084 235 3554
http://www.connext.co.za
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users
--
Geert Bevin Uwyn bvba GTalk: [EMAIL PROTECTED]
"Use what you need" Avenue de Scailmont 34 Skype: gbevin
http://www.uwyn.com 7170 Manage, Belgium AIM: geertbevin
gbevin at uwyn dot com Tel: +32 64 84 80 03 Mobile: +32 477 302 599
PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9
Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users