First of all: Thank you for the answers

Adam Levine wrote:
>I'm guessing you're using JBoss.
>
>If your tables already exist, it shouldn't be attempting to create them.
>If your tables already exist as shown, they should be fine (with the fk
>column in the phone table).

>What is the exact error message you're receiving? I know Jboss will let you
>know that the table already exists, and that it won't create it -- but
>that's informational only, and not an error.

You guess fine: I use JBoss 3.0.6

The error is the following:
12:13:13,502 ERROR [STDERR] javax.ejb.CreateException: Could not create
entity:java.sql.SQLException: ORA-00957: Column name duplicate

I manage to see the SQL code sent to the database:
INSERT INTO PERSONNE (NUMPER, NOMPER, PRENOMPER, ADRPER, VILLEPER, PAYSPER,
TELPER, FAXPER, EMAILPER, PORTPER, TYPPER, TITREPER, DESCPER, ETATPER,
NUMETBPER, NUMSOCPER, CIVILPER, INITUTIMODPER, DATEMODPER, MAILPER,
THMAILPER, NUMETBPER) VALUES (...)

We can see that NUMETBPER appears 2 times. One for the setNumetbper (the FK)
and I guess JBoss adds one for the CMR field.
How can I avoid this ?
I try to remove the persistence tag on set/get-Numetbper but it generates
errors...



Harkness, David wrote:
>I use setLocalUserId in ejbPostCreate to hook up the relation. This is a
bi-directional
>relation (all relations in my app are a mix of bi/uni-directional 1:N), and
in all cases
>I'm
>setting the "parent" (1) bean in the "children" (N) beans. Are you setting
your CMR fields
>in ejbCreate rather than ejbPostCreate?

According to your advice, I try to use the setNumetbper in the ejbPostCreate
but get still the same error of Column name duplicate...

I'm a bit lost :(
Must I change all my model ? (but my tables are imposed)
Thank you.





-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to