Discussion:
[Middlegen-user] Table Name problem
hari babu
2003-01-10 08:01:07 UTC
Permalink
hai,
I created a table called Chumma in Oracle with two columns Age1 Number(3), Age2 Number(3).
here the primary key is Age2.

I have used "DEEPA" as my schema.
Then i generated entity bean code JARed it.
When i deploy this jar in JBoss, the query what Jboss generates to create the table is CREATE TABLE DEEPA.CHUMMA AGE1 NUMBER(3) NOT NULL, AGE1 NUMBER(3) NOT NULL, CONSTRAINT PK_DEEPA.CHUMMA PRIMARY KEY(AGE2)). According to Oracle syntax there should not be any '.' in the constraint name. Is there anyway to solve this



Hari Babu







---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
Aslak Hellesoy
2003-01-10 09:05:07 UTC
Permalink
useSchemaPrefix="false" in your cmp20 plugin.

http://boss.bekk.no/boss/middlegen/plugins/simple.html

This attribute is currently only available in the CVS code.

Also see the original RFE:
http://sourceforge.net/tracker/index.php?func=detail&aid=623615&group_id=360
44&atid=415993

HTH,
Aslak
-----Original Message-----
From: middlegen-user-***@lists.sourceforge.net
[mailto:middlegen-user-***@lists.sourceforge.net]On Behalf Of hari babu
Sent: 10. januar 2003 11:01
To: middlegen-***@lists.sourceforge.net
Subject: [Middlegen-user] Table Name problem


hai,
I created a table called Chumma in Oracle with two columns Age1 Number(3),
Age2 Number(3).
here the primary key is Age2.

I have used "DEEPA" as my schema.
Then i generated entity bean code JARed it.
When i deploy this jar in JBoss, the query what Jboss generates to create
the table is CREATE TABLE DEEPA.CHUMMA AGE1 NUMBER(3) NOT NULL, AGE1
NUMBER(3) NOT NULL, CONSTRAINT PK_DEEPA.CHUMMA PRIMARY KEY(AGE2)).
According to Oracle syntax there should not be any '.' in the constraint
name. Is there anyway to solve this



Hari Babu









----------------------------------------------------------------------------
--
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
Matthias Flor
2003-01-10 09:41:02 UTC
Permalink
Post by Aslak Hellesoy
useSchemaPrefix="false" in your cmp20 plugin.
http://boss.bekk.no/boss/middlegen/plugins/simple.html
This attribute is currently only available in the CVS code.
-----Original Message-----
*hari babu
*Sent:* 10. januar 2003 11:01
*Subject:* [Middlegen-user] Table Name problem
hai,
I created a table called Chumma in Oracle with two columns Age1
Number(3), Age2 Number(3).
here the primary key is Age2.
I have used "DEEPA" as my schema.
Then i generated entity bean code JARed it.
When i deploy this jar in JBoss, the query what Jboss generates to
create the table is CREATE TABLE DEEPA.CHUMMA AGE1 NUMBER(3) NOT
NULL, AGE1 NUMBER(3) NOT NULL, CONSTRAINT PK_*DEEPA.CHUMMA PRIMARY
KEY(AGE2)). *According to Oracle syntax there should not be any *'.'
If you run the middlegen task without the schema-prefix against a oracle
db it won't find the table(s).
If you run jboss with the same jdbc-driver you used for the
middlegen-task jboss will choke on the prefix as in your case.

Thus, you will need the prefix for the middlegen-task but not for jboss
(e.g. in the xdoclet-tag @ejb.persistence table-name). This may be also
true for other RDBMS/Application-Server combinations than Oracle/Jboss.
Aslak statet this also in the RFE.

If you want to use no prefixes at all you should set public synonyms on
your db-tables. But i think it's easier to use the switch mentioned above.

cheers,
Matthias
Aslak Hellesoy
2003-01-10 10:01:07 UTC
Permalink
Post by Aslak Hellesoy
-----Original Message-----
Flor
Sent: 10. januar 2003 12:40
Subject: Re: [Middlegen-user] Table Name problem
Post by Aslak Hellesoy
useSchemaPrefix="false" in your cmp20 plugin.
http://boss.bekk.no/boss/middlegen/plugins/simple.html
This attribute is currently only available in the CVS code.
-----Original Message-----
*hari babu
*Sent:* 10. januar 2003 11:01
*Subject:* [Middlegen-user] Table Name problem
hai,
I created a table called Chumma in Oracle with two columns Age1
Number(3), Age2 Number(3).
here the primary key is Age2.
I have used "DEEPA" as my schema.
Then i generated entity bean code JARed it.
When i deploy this jar in JBoss, the query what Jboss generates to
create the table is CREATE TABLE DEEPA.CHUMMA AGE1 NUMBER(3) NOT
NULL, AGE1 NUMBER(3) NOT NULL, CONSTRAINT PK_*DEEPA.CHUMMA PRIMARY
KEY(AGE2)). *According to Oracle syntax there should not be any *'.'
If you run the middlegen task without the schema-prefix against a oracle
Matthias, it sounds as if we're talking about two different attributes.

Let's be accurate here... There is nothing called "schema-prefix" in the
middlegen task. You're probably referring to the "schema" attribute in the
middlegen task.

Use the middlegen task's schema attribute to help Middlegen *find* your
tables.
http://boss.bekk.no/boss/middlegen/ant/index.html#schema

Use the plugin's useSchemaPrefix attribute to tell the plugin how to
*output* the table names in generated code.
http://boss.bekk.no/boss/middlegen/plugins/simple.html#useSchemaPrefix

Aslak
Post by Aslak Hellesoy
db it won't find the table(s).
If you run jboss with the same jdbc-driver you used for the
middlegen-task jboss will choke on the prefix as in your case.
Thus, you will need the prefix for the middlegen-task but not for jboss
true for other RDBMS/Application-Server combinations than Oracle/Jboss.
Aslak statet this also in the RFE.
If you want to use no prefixes at all you should set public synonyms on
your db-tables. But i think it's easier to use the switch mentioned above.
cheers,
Matthias
-------------------------------------------------------
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...