I've used turbine in the past and I've loved using it.  Thanks to all the
developers for making it possible generate the outlines of a database
driven web app in 10 minutes.

This is the first time I've tried to use Torque on it's own and I'm a
little unclear on things.  So far, I've built torque from the source in
CVS and unzipped it somewheres else.  

>From there, I'm trying to use the schema that it comes with about the
interplanetary civilizations.  I changed the lines torque.database.* in
Torque.properties to reflect my configuration (which works with the TDK
and with plain JDBC stuff).

I wrote a simple Test class:
public class Test{
 public static void main(String[] args){
  try{
   Torque.init("Torque.properties");
   Civilization c =  new Civilization();
   c.setName("Babel");
   c.save();
  } catch(Exception e){

Now we get into things I don't understand.  Where does Torque normally
find org.gjt.mm.mysql.Driver if the mm jar isn't explicity in the
classpath?  Cause if I don't have it in the classpath, the code exits with
a "DBConnection is null" exception, but it doesn't ever complain about not
being able to load the class.  Is this a case of one "class not found" ex
being caught and some other exception being thrown?

If I do have it in the classpath ("mm.mysql-2.0.7-bin.jar"), I get a null
pointer exception from BasePeer line 765.  At this line, there's code like
this:

        DatabaseMap dbMap = Torque.getDatabaseMap( criteria.getDbName() );
        System.out.println("dbMap: " + dbMap);
        TableMap tableMap = dbMap.getTable(tableName);
        System.out.println("tableMap: " +tableMap);
        Object keyInfo = tableMap.getPrimaryKeyMethodInfo();

When this is run, dbMap is non-null, but tableMap is.  I don't really
understand what is happening here, but it looks like torque's trying to
get some info on the table Civilization, and is being told that there is
no table Civilization.  In the db, there is.  And in the schema, there is.
And in the Peer class directory, there are all the right classes.  What
should I be looking for here?

Also, I personally was a bit confused when I decided to use Torque on it's
own about torque-2.1 and the torque in CVS.  If you look at the docs on
the webpage, it doesn't say anything about either, it just says "torque
has been decoupled from turine and the decoupled version will be used from
2.2 on".  If you read the mailing list archives though, you find a million
people saying, "don't use 2.1, get the version from cvs and build it."
Maybe a note about this would be in order?  If I personally feel the
documentation has a shortcoming, is the generally encouraged practice
"make whatever change you want to the xdoc and mail it to turbine-dev and
see what they think"?

Thanks,
jeb.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to