Hi Greg,
I've used JDBCOMGenerator successfully only yesterday, but I haven't used
MySqlOMGenerator recently.
Usually selectCriteria.put( ?, criteria.remove(?) ) means that there is something
wrong with how the primary key is retrieved. An
empty object class usually means and error with the column parsing - including the
primary key - duh :-). This is a guess, but it
seems if the DatabaseMap from which your classes should be generated is erroneous.
I'm not sure how the MySQLSchemaToDatabaseMap (used by MySqlOmGenerator to create the
DatabaseMap) works, but I suspect that it does
not like whitespace before column definitions. I think that if you remove the
whitespace before the column names and
primary/foreign key definitions your problem might be solved. I'll have a look anyway
at some stage.
~ Leon
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 21, 2000 10:25 PM
Subject: Problem with MySqlOMGenerator
> I've just switched from using the NewGenerateMapBuilderTask to the
> MySqlOMGenerator to generate my DOs, MapBuilders, and Peers. I have a MySQL
> schema that I've used successfully with NewGenerateMapBuilderTask:
>
> CREATE TABLE TASKMASTER_TASK(
> TASK_ID INTEGER NOT NULL,
> OWNER_ID INTEGER NOT NULL,
> TASK_NAME VARCHAR(255) NOT NULL,
> TASK_DESC VARCHAR(255) NOT NULL,
> PARENT_TASK_ID INTEGER,
> PRIMARY KEY (TASK_ID),
> FOREIGN KEY (PARENT_TASK_ID)
> REFERENCES TASKMASTER_TASK(TASK_ID)
> )
> ;
>
> However, the classes generated by MySqlOMGenerator don't compile. For example,
> the generated TaskPeer.java has lines that look like:
>
> selectCriteria.put( ?, criteria.remove(?) );
>
> and Task.java looks like:
>
> package com.codespin.taskmaster.om;
>
>
>
> // Turbine
> import org.apache.turbine.om.BaseObject;
> import java.util.*;
>
> /** This class was autogenerated by GenerateMapBuilder on: Fri Jul 21 13:12:56 P
> DT 2000 */
> public class Task extends BaseObject
> {
>
> }
>
> Is the MySqlOMGenerator (and the new OMGenerator classes in general)
> functional? Are there some changes to how the Ant taskdef should be set up for
> them (aside from the obvious change in the class used)? Anything else I might
> be doing wrong?
>
> I'll happily look at this on my own, but just want to make sure that this isn't
> a problem that is fixable by some changes in my schema file, ant build script,
> or anything else.
>
> Thanks,
>
> -Greg-
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]