Discussion:
[Middlegen-user] Re: foreign key problem
Eivind Waaler
2004-01-28 01:45:57 UTC
Permalink
Hi, this is unfortunately a known bug which hasen't been fixed yet.

Maybe someone on the list has a solution?

This is of course a major problem, I'll try to get it fixed asap.

Regards
.eivind
hi,
The list does not seem to respont that's why I contact you
this way.
I have an urgent and tricky problem if a table contains two
Your Help is highly appreciated.
Thanks
ALex.
--- here is the message I posted to the list ----
In the following simple sample middlegen generates strange code.
Im a DB novice so maybe the sql code is not right, but
jboss/hsqldb had
CREATE TABLE "addresses" (
"address_id" INT NOT NULL,
"city" VARCHAR NOT NULL,
"street" VARCHAR NOT NULL,
PRIMARY KEY("address_id")
);
CREATE TABLE "customers" (
"customer_id" INT NOT NULL,
"first_name" VARCHAR NOT NULL,
"last_name" VARCHAR NOT NULL,
"login" VARCHAR NOT NULL,
"password" VARCHAR NOT NULL,
"billing_address_id_fk" INT NOT NULL,
"shipping_address_id_fk" INT NOT NULL,
PRIMARY KEY("customer_id"),
FOREIGN KEY ("billing_address_id_fk") REFERENCES
"addresses"("address_id"),
FOREIGN KEY ("shipping_address_id_fk") REFERENCES
"addresses"("address_id")
);
In the CustomerValue.class it generates the following code
where the
private java.lang.Integer billingAddressIdFk;
private boolean billingAddressIdFkHasBeenSet = false;
private java.lang.Integer shippingAddressIdFk;
private boolean shippingAddressIdFkHasBeenSet = false;
private flowshop.interfaces.AddressLightValue Address;
// duplicate
private boolean AddressHasBeenSet = false; // duplicate
private flowshop.interfaces.AddressLightValue Address;
// duplicate
private boolean AddressHasBeenSet = false; // duplicate
has anybody has a hint whats wrong with the sql code?
I use the cvs version of middlegen with jboss 3.2.3 with
hsqldb 1.7.1
chers
Alex.
José Manuel Molina Pascual
2004-01-28 07:15:20 UTC
Permalink
In the same line, when it comes to generate the cmp deployment
descriptors (at least in jboss) it comes out with more or less the same
thing, it generates hte same entry two (or the number of times the FK is
used in the child table) and the deployment fails
Post by Eivind Waaler
Hi, this is unfortunately a known bug which hasen't been fixed yet.
Maybe someone on the list has a solution?
This is of course a major problem, I'll try to get it fixed asap.
Regards
.eivind
hi,
The list does not seem to respont that's why I contact you
this way.
I have an urgent and tricky problem if a table contains two
Your Help is highly appreciated.
Thanks
ALex.
--- here is the message I posted to the list ----
In the following simple sample middlegen generates strange code.
Im a DB novice so maybe the sql code is not right, but
jboss/hsqldb had
CREATE TABLE "addresses" (
"address_id" INT NOT NULL,
"city" VARCHAR NOT NULL,
"street" VARCHAR NOT NULL,
PRIMARY KEY("address_id")
);
CREATE TABLE "customers" (
"customer_id" INT NOT NULL,
"first_name" VARCHAR NOT NULL,
"last_name" VARCHAR NOT NULL,
"login" VARCHAR NOT NULL,
"password" VARCHAR NOT NULL,
"billing_address_id_fk" INT NOT NULL,
"shipping_address_id_fk" INT NOT NULL,
PRIMARY KEY("customer_id"),
FOREIGN KEY ("billing_address_id_fk") REFERENCES
"addresses"("address_id"),
FOREIGN KEY ("shipping_address_id_fk") REFERENCES
"addresses"("address_id")
);
In the CustomerValue.class it generates the following code
where the
private java.lang.Integer billingAddressIdFk;
private boolean billingAddressIdFkHasBeenSet = false;
private java.lang.Integer shippingAddressIdFk;
private boolean shippingAddressIdFkHasBeenSet = false;
private flowshop.interfaces.AddressLightValue Address;
// duplicate
private boolean AddressHasBeenSet = false; // duplicate
private flowshop.interfaces.AddressLightValue Address;
// duplicate
private boolean AddressHasBeenSet = false; // duplicate
has anybody has a hint whats wrong with the sql code?
I use the cvs version of middlegen with jboss 3.2.3 with
hsqldb 1.7.1
chers
Alex.
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
--
José Manuel Molina Pascual
***@stratesys.es <mailto:***@stratesys.es>
/*
Stratesys Consulting */
C/ Juan de Mena, 6
Madrid 28014
Tel (+34) 91 360 49 60
Loading...