This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 79216 - CMP bean generating (DISCOUNT_CODE) don't work
Summary: CMP bean generating (DISCOUNT_CODE) don't work
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL: http://www.netbeans.org/kb/50/quickst...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-27 14:38 UTC by szenesg
Modified: 2006-08-02 09:33 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Tables view (10.69 KB, image/gif)
2006-07-06 13:59 UTC, szenesg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description szenesg 2006-06-27 14:38:48 UTC
On "NetBeans IDE 5.0 Quick Start Guide for J2EE Applications" page of Getting 
Started guide it says: 

"The IDE creates the CMP bean for the CUSTOMER table and for any tables that 
are referenced from CUSTOMER (DISCOUNT_CODE)."

Well, the IDE did NOT create the CMP bean for DISCOUNT_CODE. How should the IDE 
know that the DISCOUNT_CODE table is referenced from CUSTOMER table? Maybe if I 
knew the answer for this question I could resolve this problem. Or is it an 
issue in the documentation?
Comment 1 Petr Jiricka 2006-07-04 15:07:10 UTC
The IDE decides based on the foreign keys. When you browse the database in the
Runtime tab, you should be able to see them. Does not look like a documentation
issue, should work. Could you please try this in the latest NetBeans 5.5 daily
build? Thanks.
Comment 2 szenesg 2006-07-06 13:59:40 UTC
Created attachment 31670 [details]
Tables view
Comment 3 szenesg 2006-07-06 14:07:34 UTC
As you can see in the attachment, the foreign key is there. What you cannot 
see, the discount_code table is also there. Still, the same problem persists.
I'm sorry, but I don't have the time to test v5.5.
Comment 4 Andrei Badea 2006-07-21 17:04:02 UTC
The attached image doesn't prove the foreign keys are retrieved correctly. The
greenish column icon means the column is an indexed one, not that it is a
foreign key. You can check that the foreign keys are retrieving by expanding the
Foreign Keys node under the table node.

However, given that you are running MySQL and that MySQL only supports foreign
keys with the InnoDB engine, which is not the default one, I think there just
aren't any foreign keys to retrieve in this case. Look at issue 79736 for more
information about primary keys on MySQL.

Closing as invalid, please reopen with further details (such as that the foreign
keys are visible under the Foreign Keys node) if I made a wrong assumption.
Comment 5 szenesg 2006-07-31 14:52:40 UTC
No, you were absolutely right, it works fine with InnoDB tables. Thanks a lot!

One last question, if I may. It may be a little bit OFF topic. I have this well-
known "javax.transaction.TransactionRolledbackException: CORBA 
TRANSACTION_ROLLEDBACK " error message. I can see what to do if I had Derby but 
I have MySQL? Everything seems OK with JDBC resources, and I can browse the 
database on Runtime pane anyway, so why the error message? What must be done in 
general?
Comment 6 Andrei Badea 2006-08-01 13:30:10 UTC
Sorry, I have never heard about this exception, so I have no idea. Try asking on
the nbj2ee@netbeans.org mailing list.
Comment 7 szenesg 2006-08-02 08:28:54 UTC
This exception has been mentioned in "Troubleshooting" section of the "NetBeans 
IDE 5.0 Quick Start Guide for J2EE Applications" 
(http://www.netbeans.org/kb/50/quickstart-j2ee.html#Troubleshooting) but I will 
do as you told me and ask this elsewhere. Thanks for your help anyway!
Comment 8 szenesg 2006-08-02 09:33:19 UTC
Final words
I've found the solution on page http://www.netbeans.org/kb/faqs/database-
connectivity.html#FaqDatabaseConnectivityError2. To put it short, the jar file 
containing the jdbc driver had to be copied under the application server (in my 
case it was mysql-connector-java-3.0.11-stable-bin.jar to be copied to 
c:\Sun\AppServer\lib directory).