On Tue, 2003-08-12 at 13:50, Mark Lowe wrote:
> Thanks.. for pointing me to the docs, they're great aren't they i've
> been reading them for days, its just a shame that as soon as you try
> anything useful they don't seem to be right..
Yeah, Jakarta documentation often leaves much to be desired. That's a
pain in the ass and wastes a lot of time. *sigh* OTOH, it's free :D
> Tell you what i'll even give you
> back the pics I've got of you and your ma.
Even if that was meant as a joke it's pretty rude.
> So come on then Dave show me how stupid I am
Redundancy sucks. You'll do fine.
> The api gives me a setApplicant(Applicant v) method which is great..
> Despite the fact it doesn't work.. Now I don't mind the fact this
> doesn't work, just that all these little not worky things seem to be a
> tad esoteric and not mentioned in the docs.. Variations of this have be
> trying the addApplication(Application v) in the applicant api, but alas
What do you mean by "doesn't work?" Do you get an exception or does it
appear as though nothing at all is happening?
Here's a simple schema file and some Jython code that works fine. I use
Jython features, but it's mostly syntactic sugar around getters/setters.
--- schema snippet ---
--- jython snippet ---
# _MY_ question: What's a good way to delete all objects from
# a table w/o knowing table structure or writing
# SQL or modifying the templates?
# Blechy code to delete all from the publisher table
allpub = Crit().add(PubPeer.NAME, "%", Crit.LIKE)
# Add publishers
addison = Pub(name = "Addison Wesley Professional")
oreilly = Pub(name = "O'Reilly")
# Add authors
dave = Author(firstName = "Dave", lastName = "Newton", \
email="firstname.lastname@example.org", lastLogin = awhileago)
matt = Author(firstName = "Matt", lastName = "Stoops", \
email="email@example.com", lastLogin = lastlogin)
# Add books
b1 = Book(title="Struts for Dave", ISBN="", pages=666, \
b2 = Book(title="JDBC does MySQL", ISBN="", pages=300, \
b3 = Book(title="Extreme Programming", ISBN="", pages=666, \
b4 = Book(title="Jython Cookbook", ISBN="", pages=300, \
b5 = Book(title="Physical Security", ISBN="", pages=500, \
books = [b1, b2, b3, b4, b5]
for book in books:
--- end snippets --
I've done a few other mappings with Torque and have Jython code for
most; I can send it to you if necessary (once I find it--switching