File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Entity beans and foreign keys Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Entity beans and foreign keys" Watch "Entity beans and foreign keys" New topic

Entity beans and foreign keys

Irsan Saparianto

Joined: Oct 03, 2001
Posts: 2
I'm having problems with Entity Beans. The problem is, i cannot insert any row (using ejbCreate) to a table that has a foreign key coloumn. I've tried using CMP and BMP, nothing worked. This is weird, all find, update, and remove methods work, except the create method. I've also checked the deployment descriptors, they're okay. Has someone had this kind of problem? Can somebody help me?
By the way, i'm using Forte 3.0 EE, iPlanet Application Server 6.0 SP3, and MS-SQL Server 2000.
Sudharsan Govindarajan
Ranch Hand

Joined: Jul 03, 2002
Posts: 319

Have u solved this problem? I am facing the same problem with Mysql 4.0.17 & JBoss 3.2.3


Joy is a radiation
chuck keuper

Joined: Mar 17, 2004
Posts: 22
I am having this exact same problem with JBuilder 9 and BES 5.2. Was a solution found??
goose li

Joined: Apr 04, 2005
Posts: 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' ' at line 1

JBuilder X

I have the same problem, I try to inert a photo into my MySQL server!
Ken Loh
Ranch Hand

Joined: Feb 16, 2005
Posts: 190
Sounds like an FK constraint. Best way to try is to construct a similar SQL query similar to the EJB-QL that you use and see what the result is if you enter it to your DB console. Only after the SQL works that you port it to EJB-QL.

My $0.02.
I agree. Here's the link:
subject: Entity beans and foreign keys
It's not a secret anymore!