This mystery will be solved if you dig into the sources of jBPM and look at the Hibernate mapping files in the org.jbpm.context.exe and the org.jbpm.context.exe.variableinstance packages. These are the files (with extension *.hbm.xml) that specify how Hibernate has to treat the jBPM objects when storing them in a database. But a prerequisite of understanding all this is familiarity with Hibernate, so you might want to read the Hibernate docs also.
Thanks Very Much Koen,
That was very nice guidance. Thank you very much for taking your time and providing me with the information.
So Hibernate handles the task of mapping classes to tables, and objects to actual rows. Hibernate generates SQL for you (cool), relieves you from manual result set handling and object conversion and keeps your application portable to all SQL databases.
Hibernate rocks indeed ;-)