You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Bergland <jo...@bergland-it.nl> on 2004/02/12 14:05:21 UTC
XDoclet LONGVARCHAR MySQL wrong column definition
Hi all,
I use the OJB XDoclet module that comes from the current CVS (few days ago) to generate my OJB configuration files and SQL (I like it a lot).
I have this attribute of type String that I want to store in a MySQL column that can handle large Strings (for example MEDIUMTEXT). I mapped the field like this:
/**
* @ojb.field
* jdbc-type="LONGVARCHAR"
*/
protected String text;
The SQL that it produces is:
"create table ... , text MEDIUMTEXT (24), ...."
The type MEDIUMTEXT is fine but mysql (and myself) doesn't like the "(24)". I looked in the ...-schema.xml. There it the XDoclet module has generated this definition for the text attribute.
<column name="text"
javaName="text"
type="LONGVARCHAR"
size="24"
/>
What can I do to prevent the OJB XDoclet module from generating the length part of the column definition.
Thanks,
Joris Wijlens
Re: XDoclet LONGVARCHAR MySQL wrong column definition
Posted by Joris Wijlens <jo...@bergland-it.nl>.
Excellent,
That did the job, thanks for the quick fix.
Joris
----- Original Message -----
From: "Thomas Dudziak" <to...@first.gmd.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, February 12, 2004 3:36 PM
Subject: Re: XDoclet LONGVARCHAR MySQL wrong column definition
> On Thu, 12 Feb 2004, Bergland wrote:
>
> > Hi all,
> >
> > I use the OJB XDoclet module that comes from the current CVS (few days
ago) to generate my OJB configuration files and SQL (I like it a lot).
> >
> > I have this attribute of type String that I want to store in a MySQL
column that can handle large Strings (for example MEDIUMTEXT). I mapped the
field like this:
> >
> > /**
> > * @ojb.field
> > * jdbc-type="LONGVARCHAR"
> > */
> > protected String text;
> >
> > The SQL that it produces is:
> >
> > "create table ... , text MEDIUMTEXT (24), ...."
> >
> > The type MEDIUMTEXT is fine but mysql (and myself) doesn't like the
"(24)". I looked in the ...-schema.xml. There it the XDoclet module has
generated this definition for the text attribute.
> >
> > <column name="text"
> > javaName="text"
> > type="LONGVARCHAR"
> > size="24"
> > />
> >
> > What can I do to prevent the OJB XDoclet module from generating the
length part of the column definition.
>
> You could check out the current version of the ojb module from CVS because
> I just fixed this bug that you've found ;-)
>
> Tom
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: XDoclet LONGVARCHAR MySQL wrong column definition
Posted by Thomas Dudziak <to...@first.gmd.de>.
On Thu, 12 Feb 2004, Bergland wrote:
> Hi all,
>
> I use the OJB XDoclet module that comes from the current CVS (few days ago) to generate my OJB configuration files and SQL (I like it a lot).
>
> I have this attribute of type String that I want to store in a MySQL column that can handle large Strings (for example MEDIUMTEXT). I mapped the field like this:
>
> /**
> * @ojb.field
> * jdbc-type="LONGVARCHAR"
> */
> protected String text;
>
> The SQL that it produces is:
>
> "create table ... , text MEDIUMTEXT (24), ...."
>
> The type MEDIUMTEXT is fine but mysql (and myself) doesn't like the "(24)". I looked in the ...-schema.xml. There it the XDoclet module has generated this definition for the text attribute.
>
> <column name="text"
> javaName="text"
> type="LONGVARCHAR"
> size="24"
> />
>
> What can I do to prevent the OJB XDoclet module from generating the length part of the column definition.
You could check out the current version of the ojb module from CVS because
I just fixed this bug that you've found ;-)
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org