Discussion:
[Middlegen-user] What's the difference ????
alexj
2003-01-18 12:37:02 UTC
Permalink
Hi I'm a bit confused when I want to see why the code generation failed.
After reducing my db schema to be very simple I can't have a good
code generation.
For exemple I just made three table like that :

/*************************************************************/
CREATE TABLE personne ( I just add more attributs
the persons table in
airline)
/*************************************************************/

personne_id INT NOT NULL,
nom VARCHAR (60) NOT NULL,
prenom VARCHAR (60) NOT NULL,
date_de_naissance DATE,
adresse VARCHAR (100),
npa INT,
ville VARCHAR (60),
telephone VARCHAR (20),
email VARCHAR (20),
PRIMARY KEY (personne_id)
);



/*************************************************************/
CREATE TABLE groupe (just like the fligths table)

/*************************************************************/

groupe_id INT NOT NULL,
nom VARCHAR (50) NOT NULL,

PRIMARY KEY (groupe_id)

);

/*************************************************************/
CREATE TABLE fait_partie ( and here just like the
reservations table
/*************************************************************/
fait_partie_id INT NOT NULL,
date_inscription DATE NOT NULL,
groupe_id_fk INT NOT NULL,
personne_id_fk INT NOT NULL,

PRIMARY KEY (fait_partie_id, groupe_id_fk,personne_id_fk),
FOREIGN KEY (groupe_id_fk) REFERENCES groupe (groupe_id),
FOREIGN KEY (personne_id_fk)REFERENCES personne (personne_id)
);


insert into personne values (1, 'jaquet','alexandre','01-05-1980','rte des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (2, 'jaquet','alexandre','01-05-1980','rte des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (3, 'jaquet','alexandre','01-05-1980','rte des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');

Just as simple as the airline sample is. Why the airline work and not my simple db script ?????? I have exactly the
same cardinality between my test and the airline sample. I can't understand....
Eivind Waaler
2003-01-18 15:29:02 UTC
Permalink
Hi, does the airline sample work for you unchanged?

Post the error messages you get (output when running the build script),
and it might be easier for us to see what's going on..

.eivind
Post by alexj
Hi I'm a bit confused when I want to see why the code generation failed.
After reducing my db schema to be very simple I can't have a good
code generation.
/*************************************************************/
CREATE TABLE personne ( I just add more attributs
the persons table in
airline)
/*************************************************************/
personne_id INT NOT NULL,
nom VARCHAR (60) NOT NULL,
prenom VARCHAR (60) NOT NULL,
date_de_naissance DATE,
adresse VARCHAR (100),
npa INT,
ville VARCHAR (60),
telephone VARCHAR (20),
email VARCHAR (20),
PRIMARY KEY (personne_id)
);
/*************************************************************/
CREATE TABLE groupe (just like the fligths table)
/*************************************************************/
groupe_id INT NOT NULL,
nom VARCHAR (50) NOT NULL,
PRIMARY KEY (groupe_id)
);
/*************************************************************/
CREATE TABLE fait_partie ( and here just like the
reservations table
/*************************************************************/
fait_partie_id INT NOT NULL,
date_inscription DATE NOT NULL,
groupe_id_fk INT NOT NULL,
personne_id_fk INT NOT NULL,
PRIMARY KEY (fait_partie_id, groupe_id_fk,personne_id_fk),
FOREIGN KEY (groupe_id_fk) REFERENCES groupe (groupe_id),
FOREIGN KEY (personne_id_fk)REFERENCES personne (personne_id)
);
insert into personne values (1, 'jaquet','alexandre','01-05-1980','rte des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (2, 'jaquet','alexandre','01-05-1980','rte des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (3, 'jaquet','alexandre','01-05-1980','rte des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
Just as simple as the airline sample is. Why the airline work and not my simple db script ?????? I have exactly the
same cardinality between my test and the airline sample. I can't understand....
alexj
2003-01-19 05:31:02 UTC
Permalink
It's really strange this morning I just take the sql script I have try
yesterday and now
I didn't get any building error.

Chears.

--
Alexandre Jaquet

----- Original Message -----
From: "Eivind Waaler" <***@tihlde.org>
To: "alexj" <***@freesurf.ch>
Cc: <middlegen-***@lists.sourceforge.net>
Sent: Saturday, January 18, 2003 6:28 PM
Subject: Re: [Middlegen-user] What's the difference ????
Post by Eivind Waaler
Hi, does the airline sample work for you unchanged?
Post the error messages you get (output when running the build script),
and it might be easier for us to see what's going on..
.eivind
Post by alexj
Hi I'm a bit confused when I want to see why the code generation failed.
After reducing my db schema to be very simple I can't have a good
code generation.
/*************************************************************/
CREATE TABLE personne ( I just add more attributs
the persons table in
airline)
/*************************************************************/
personne_id INT NOT NULL,
nom VARCHAR (60) NOT NULL,
prenom VARCHAR (60) NOT NULL,
date_de_naissance DATE,
adresse VARCHAR (100),
npa INT,
ville VARCHAR (60),
telephone VARCHAR (20),
email VARCHAR (20),
PRIMARY KEY (personne_id)
);
/*************************************************************/
CREATE TABLE groupe (just like the fligths table)
/*************************************************************/
groupe_id INT NOT NULL,
nom VARCHAR (50) NOT NULL,
PRIMARY KEY (groupe_id)
);
/*************************************************************/
CREATE TABLE fait_partie ( and here just like the
reservations table
/*************************************************************/
fait_partie_id INT NOT NULL,
date_inscription DATE NOT NULL,
groupe_id_fk INT NOT NULL,
personne_id_fk INT NOT NULL,
PRIMARY KEY (fait_partie_id, groupe_id_fk,personne_id_fk),
FOREIGN KEY (groupe_id_fk) REFERENCES groupe (groupe_id),
FOREIGN KEY (personne_id_fk)REFERENCES personne (personne_id)
);
insert into personne values (1, 'jaquet','alexandre','01-05-1980','rte
des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
Post by Eivind Waaler
Post by alexj
insert into personne values (2, 'jaquet','alexandre','01-05-1980','rte
des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
Post by Eivind Waaler
Post by alexj
insert into personne values (3, 'jaquet','alexandre','01-05-1980','rte
des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
Post by Eivind Waaler
Post by alexj
Just as simple as the airline sample is. Why the airline work and not
my simple db script ?????? I have exactly the
Post by Eivind Waaler
Post by alexj
same cardinality between my test and the airline sample. I can't understand....
-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will
allow you to extend the highest allowed 128 bit encryption to all your
clients even if they use browsers that are limited to 40 bit encryption.
Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
alexj
2003-01-19 05:55:02 UTC
Permalink
Hi all,

Rigth now I got an error when I deploy my ear to JBoss 3.0.4 :

org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable: (java.sql.SQLException: Wrong data type: INT4 in statement [CREATE TABLE RESSOURCE (id_ressource INT4 NOT NULL, nom TEXT, id_type_fk INT4, id_type_fk INT4, CONSTRAINT PK_RESSOURCE PRIMARY KEY (id_ressource))])
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:175)

I can see it's a trouble based on duplication of the id_type_fk but I didn't find where to modify this.
I have see if it's an error on the jboss.xml, jbosscmp-jdbc or ejb files but didn't find where I have
to fix it.

Thanks for your help.

--
Alexandre Jaquet
----- Original Message -----
From: alexj
To: middlegen-***@lists.sourceforge.net
Sent: Saturday, January 18, 2003 3:36 PM
Subject: [Middlegen-user] What's the difference ????


Hi I'm a bit confused when I want to see why the code generation failed.
After reducing my db schema to be very simple I can't have a good
code generation.
For exemple I just made three table like that :

/*************************************************************/
CREATE TABLE personne ( I just add more attributs
the persons table in
airline)
/*************************************************************/

personne_id INT NOT NULL,
nom VARCHAR (60) NOT NULL,
prenom VARCHAR (60) NOT NULL,
date_de_naissance DATE,
adresse VARCHAR (100),
npa INT,
ville VARCHAR (60),
telephone VARCHAR (20),
email VARCHAR (20),
PRIMARY KEY (personne_id)
);



/*************************************************************/
CREATE TABLE groupe (just like the fligths table)

/*************************************************************/

groupe_id INT NOT NULL,
nom VARCHAR (50) NOT NULL,

PRIMARY KEY (groupe_id)

);

/*************************************************************/
CREATE TABLE fait_partie ( and here just like the
reservations table
/*************************************************************/
fait_partie_id INT NOT NULL,
date_inscription DATE NOT NULL,
groupe_id_fk INT NOT NULL,
personne_id_fk INT NOT NULL,

PRIMARY KEY (fait_partie_id, groupe_id_fk,personne_id_fk),
FOREIGN KEY (groupe_id_fk) REFERENCES groupe (groupe_id),
FOREIGN KEY (personne_id_fk)REFERENCES personne (personne_id)
);


insert into personne values (1, 'jaquet','alexandre','01-05-1980','rte des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (2, 'jaquet','alexandre','01-05-1980','rte des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (3, 'jaquet','alexandre','01-05-1980','rte des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');

Just as simple as the airline sample is. Why the airline work and not my simple db script ?????? I have exactly the
same cardinality between my test and the airline sample. I can't understand....
Aslak Hellesøy
2003-01-19 10:19:17 UTC
Permalink
Try fkcmp="false" in the cmp20 plugin.

In my last answer I asked you to read
http://boss.bekk.no/boss/middlegen/nude.html. Did you read it?

Aslak
-----Original Message-----
From: middlegen-user-***@lists.sourceforge.net
[mailto:middlegen-user-***@lists.sourceforge.net]On Behalf Of alexj
Sent: 19. januar 2003 08:54
To: alexj; middlegen-***@lists.sourceforge.net
Subject: [Middlegen-user] Deployement


Hi all,

Rigth now I got an error when I deploy my ear to JBoss 3.0.4 :

org.jboss.deployment.DeploymentException: Error while creating table; -
nested throwable: (java.sql.SQLException: Wrong data type: INT4 in statement
[CREATE TABLE RESSOURCE (id_ressource INT4 NOT NULL, nom TEXT, id_type_fk
INT4, id_type_fk INT4, CONSTRAINT PK_RESSOURCE PRIMARY KEY (id_ressource))])
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand
.java:175)

I can see it's a trouble based on duplication of the id_type_fk but I
didn't find where to modify this.
I have see if it's an error on the jboss.xml, jbosscmp-jdbc or ejb files
but didn't find where I have
to fix it.

Thanks for your help.

--
Alexandre Jaquet
----- Original Message -----
From: alexj
To: middlegen-***@lists.sourceforge.net
Sent: Saturday, January 18, 2003 3:36 PM
Subject: [Middlegen-user] What's the difference ????


Hi I'm a bit confused when I want to see why the code generation failed.
After reducing my db schema to be very simple I can't have a good
code generation.
For exemple I just made three table like that :

/*************************************************************/
CREATE TABLE personne ( I just add more attributs
the persons table in
airline)
/*************************************************************/

personne_id INT NOT NULL,
nom VARCHAR (60) NOT NULL,
prenom VARCHAR (60) NOT NULL,
date_de_naissance DATE,
adresse VARCHAR (100),
npa INT,
ville VARCHAR (60),
telephone VARCHAR (20),
email VARCHAR (20),
PRIMARY KEY (personne_id)
);



/*************************************************************/
CREATE TABLE groupe (just like the fligths table)

/*************************************************************/

groupe_id INT NOT NULL,
nom VARCHAR (50) NOT NULL,

PRIMARY KEY (groupe_id)

);

/*************************************************************/
CREATE TABLE fait_partie ( and here just like the
reservations table
/*************************************************************/
fait_partie_id INT NOT NULL,
date_inscription DATE NOT NULL,
groupe_id_fk INT NOT NULL,
personne_id_fk INT NOT NULL,

PRIMARY KEY (fait_partie_id, groupe_id_fk,personne_id_fk),
FOREIGN KEY (groupe_id_fk) REFERENCES groupe (groupe_id),
FOREIGN KEY (personne_id_fk)REFERENCES personne (personne_id)
);


insert into personne values (1, 'jaquet','alexandre','01-05-1980','rte
des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (2, 'jaquet','alexandre','01-05-1980','rte
des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (3, 'jaquet','alexandre','01-05-1980','rte
des Noisetiers 17',1782,'Belfaux', '0264755353','alexj');

Just as simple as the airline sample is. Why the airline work and not
my simple db script ?????? I have exactly the
same cardinality between my test and the airline sample. I can't
understand....
alexj
2003-01-19 11:36:03 UTC
Permalink
Yes I have read but nothing work correctly, maybe you can try the sql scr=
ipt
I have post previously,
it's the easyer way to found what's wrong.
And another question if I made some change manually into the code how can=
I
recompile it without
runing the whole process described into the build.xml ?

Thanks for your support.

--
Alexandre Jaquet
----- Original Message -----
From: Aslak Helles=F8y
To: alexj ; middlegen-***@lists.sourceforge.net
Sent: Sunday, January 19, 2003 1:19 PM
Subject: RE: [Middlegen-user] Deployement


Try fkcmp=3D"false" in the cmp20 plugin.

In my last answer I asked you to read
http://boss.bekk.no/boss/middlegen/nude.html. Did you read it?

Aslak
-----Original Message-----
From: middlegen-user-***@lists.sourceforge.net
[mailto:middlegen-user-***@lists.sourceforge.net]On Behalf Of alexj
Sent: 19. januar 2003 08:54
To: alexj; middlegen-***@lists.sourceforge.net
Subject: [Middlegen-user] Deployement


Hi all,

Rigth now I got an error when I deploy my ear to JBoss 3.0.4 :

org.jboss.deployment.DeploymentException: Error while creating table; -
nested throwable: (java.sql.SQLException: Wrong data type: INT4 in statem=
ent
[CREATE TABLE RESSOURCE (id_ressource INT4 NOT NULL, nom TEXT, id_type_fk
INT4, id_type_fk INT4, CONSTRAINT PK_RESSOURCE PRIMARY KEY (id_ressource)=
)])
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartComm=
and
.java:175)

I can see it's a trouble based on duplication of the id_type_fk but I did=
n't
find where to modify this.
I have see if it's an error on the jboss.xml, jbosscmp-jdbc or ejb files =
but
didn't find where I have
to fix it.

Thanks for your help.

--
Alexandre Jaquet
----- Original Message -----
From: alexj
To: middlegen-***@lists.sourceforge.net
Sent: Saturday, January 18, 2003 3:36 PM
Subject: [Middlegen-user] What's the difference ????


Hi I'm a bit confused when I want to see why the code generation failed.
After reducing my db schema to be very simple I can't have a good
code generation.
For exemple I just made three table like that :

/*************************************************************/
CREATE TABLE personne ( I just add more attributs
the persons table in
airline)
/*************************************************************/

personne_id INT NOT NULL,
nom VARCHAR (60) NOT NULL,
prenom VARCHAR (60) NOT NULL,
date_de_naissance DATE,
adresse VARCHAR (100),
npa INT,
ville VARCHAR (60),
telephone VARCHAR (20),
email VARCHAR (20),
PRIMARY KEY (personne_id)
);



/*************************************************************/
CREATE TABLE groupe (just like the fligths table)

/*************************************************************/

groupe_id INT NOT NULL,
nom VARCHAR (50) NOT NULL,

PRIMARY KEY (groupe_id)

);

/*************************************************************/
CREATE TABLE fait_partie ( and here just like the
reservations table
/*************************************************************/
fait_partie_id INT NOT NULL,
date_inscription DATE NOT NULL,
groupe_id_fk INT NOT NULL,
personne_id_fk INT NOT NULL,

PRIMARY KEY (fait_partie_id, groupe_id_fk,personne_id_fk),
FOREIGN KEY (groupe_id_fk) REFERENCES groupe (groupe_id),
FOREIGN KEY (personne_id_fk)REFERENCES personne (personne_id)
);


insert into personne values (1, 'jaquet','alexandre','01-05-1980','rte de=
s
Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (2, 'jaquet','alexandre','01-05-1980','rte de=
s
Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (3, 'jaquet','alexandre','01-05-1980','rte de=
s
Noisetiers 17',1782,'Belfaux', '0264755353','alexj');

Just as simple as the airline sample is. Why the airline work and not my
simple db script ?????? I have exactly the
same cardinality between my test and the airline sample. I can't
understand....
Aslak Hellesøy
2003-01-19 12:09:03 UTC
Permalink
Post by Aslak Hellesøy
-----Original Message-----
Sent: 19. januar 2003 14:35
Subject: Re: [Middlegen-user] Deployement
Yes I have read but nothing work correctly, maybe you can try the
"Nothing work correctly" is pretty useless information. What am I to make
out of that?

I guess the message didn't come through. I was only trying to make you
search the mailing list archives. You're not the first one having these
problems and asking these questions. You'll find dozens of posts about this.

If a db column participates in both a CMR and a CMP, JBoss 3.x will choke.
It's a JBoss bug. That's why Middlegen has the fkcmp attribute:
http://boss.bekk.no/boss/middlegen/plugins/cmp20.html#fkcmp

Did you try to set it to false as I instructed you in my previous mail?
Please answer yes or no, and also tell us whether it had an effect or not.
When we give advice, please tell us in your follow up mails whether or not
you followed the advice, and what the result was. If you don't do this
you'll leave us clueless about what's happening on your side.

Aslak
Post by Aslak Hellesøy
sql script
I have post previously,
it's the easyer way to found what's wrong.
And another question if I made some change manually into the code
how can I
recompile it without
runing the whole process described into the build.xml ?
That's a pure Ant question. Try this:

ant -Dmiddlegen.skip=true
Post by Aslak Hellesøy
Thanks for your support.
--
Alexandre Jaquet
----- Original Message -----
From: Aslak Hellesøy
Sent: Sunday, January 19, 2003 1:19 PM
Subject: RE: [Middlegen-user] Deployement
Try fkcmp="false" in the cmp20 plugin.
In my last answer I asked you to read
http://boss.bekk.no/boss/middlegen/nude.html. Did you read it?
Aslak
-----Original Message-----
Sent: 19. januar 2003 08:54
Subject: [Middlegen-user] Deployement
Hi all,
org.jboss.deployment.DeploymentException: Error while creating table; -
nested throwable: (java.sql.SQLException: Wrong data type: INT4
in statement
[CREATE TABLE RESSOURCE (id_ressource INT4 NOT NULL, nom TEXT, id_type_fk
INT4, id_type_fk INT4, CONSTRAINT PK_RESSOURCE PRIMARY KEY
(id_ressource))])
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCSt
artCommand
.java:175)
I can see it's a trouble based on duplication of the id_type_fk
but I didn't
find where to modify this.
I have see if it's an error on the jboss.xml, jbosscmp-jdbc or
ejb files but
didn't find where I have
to fix it.
Thanks for your help.
--
Alexandre Jaquet
----- Original Message -----
From: alexj
Sent: Saturday, January 18, 2003 3:36 PM
Subject: [Middlegen-user] What's the difference ????
Hi I'm a bit confused when I want to see why the code generation failed.
After reducing my db schema to be very simple I can't have a good
code generation.
/*************************************************************/
CREATE TABLE personne ( I just add more attributs
the persons table in
airline)
/*************************************************************/
personne_id INT NOT NULL,
nom VARCHAR (60) NOT NULL,
prenom VARCHAR (60) NOT NULL,
date_de_naissance DATE,
adresse VARCHAR (100),
npa INT,
ville VARCHAR (60),
telephone VARCHAR (20),
email VARCHAR (20),
PRIMARY KEY (personne_id)
);
/*************************************************************/
CREATE TABLE groupe (just like the fligths table)
/*************************************************************/
groupe_id INT NOT NULL,
nom VARCHAR (50) NOT NULL,
PRIMARY KEY (groupe_id)
);
/*************************************************************/
CREATE TABLE fait_partie ( and here just like the
reservations table
/*************************************************************/
fait_partie_id INT NOT NULL,
date_inscription DATE NOT NULL,
groupe_id_fk INT NOT NULL,
personne_id_fk INT NOT NULL,
PRIMARY KEY (fait_partie_id, groupe_id_fk,personne_id_fk),
FOREIGN KEY (groupe_id_fk) REFERENCES groupe (groupe_id),
FOREIGN KEY (personne_id_fk)REFERENCES personne (personne_id)
);
insert into personne values (1, 'jaquet','alexandre','01-05-1980','rte des
Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (2, 'jaquet','alexandre','01-05-1980','rte des
Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
insert into personne values (3, 'jaquet','alexandre','01-05-1980','rte des
Noisetiers 17',1782,'Belfaux', '0264755353','alexj');
Just as simple as the airline sample is. Why the airline work and not my
simple db script ?????? I have exactly the
same cardinality between my test and the airline sample. I can't
understand....
Loading...