Discussion:
[Middlegen-user] Optional fields and ints
David Nouls
2002-08-09 06:34:04 UTC
Permalink
Hello,

I am using the latest CVS version of Middlegen to generate EntityBeans with
CMP using a MySQL database.

I have tables where there are integer fields that are optional.
Middlegen generates getters and setters for these fields using int instead
of Integer!
So in fact I can not set those fields to null. Using a dummy id (-1) instead
does not
work because the database checks relations and throws an exception if I set
the value to an
unexisting id.

How can I force middlegen to use Integer instead of int ?

/)avid
a***@netcom.no
2002-08-09 07:04:02 UTC
Permalink
Use the gui, select the db column and change the type in the combo at
the bottom. You need JDK 1.4 if you want Middlegen to remember what you
did until the next time you run it. On JDK 1.3 You'll have to do this
every time.

Aslak

----- Original Message -----
From: "David Nouls" <***@resolution.be>
Date: Friday, August 9, 2002 10:38 am
Subject: [Middlegen-user] Optional fields and ints
Post by David Nouls
Hello,
I am using the latest CVS version of Middlegen to generate
EntityBeans with
CMP using a MySQL database.
I have tables where there are integer fields that are optional.
Middlegen generates getters and setters for these fields using int
insteadof Integer!
So in fact I can not set those fields to null. Using a dummy id (-
1) instead
does not
work because the database checks relations and throws an exception
if I set
the value to an
unexisting id.
How can I force middlegen to use Integer instead of int ?
/)avid
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...