-
1. Re: Database foreign keys must be "not null"?
Marco DeFreitas May 21, 2002 8:27 PM (in response to Marco DeFreitas)Shoot! I see someone posted a similar question... sorry...
But a good book recommendation would still be appreciated. -
2. Re: Database foreign keys must be "not null"?
Pete Luellen May 21, 2002 9:54 PM (in response to Marco DeFreitas)I've been using "Mastering Enterprise JavaBeans" by Ed Roman. I got it with a 20% discount at Barnes & Noble. It's pretty well written I think but (as you mention) fairly generic. No jboss deployment descriptors. In fact, I think the downloadable source code assumes a weblogic deployment.
I've also been using "Java Tools for Extreme Programming" by Rick Hightower. Also good. Also generic. Nothing jboss specific.
I'm thinking of putting together a set of simple examples (with jboss deployment) on my web site. But that probably won't happen for a couple of weeks.
Good luck. -
3. Re: Database foreign keys must be "not null"?
Dain Sundstrom May 22, 2002 2:11 AM (in response to Marco DeFreitas)That is the way it is now, and it will change in a future release.
-
4. Re: Database foreign keys must be "not null"?
Tim Fox May 22, 2002 3:58 AM (in response to Marco DeFreitas)As I mentioned in the other post.
I you add an insert trigger on your table, that changes nulls into "some special key" when inserted into your table, you can keep the benefits of referential integrity and still use jboss 3.0 until it gets implemented.
(This assumes your db supports triggers)
Tim -
5. Re: Database foreign keys must be "not null"?
Dain Sundstrom May 22, 2002 10:33 AM (in response to Marco DeFreitas)You will have to handle updates also, as on delete all fk fields are set null. This is required by the remove protocol in the EJB spec.
-
6. Re: Database foreign keys must be "not null"?
leela Aug 6, 2002 11:32 AM (in response to Marco DeFreitas)I have foreign Key Type INTEGER , How to make it NULLABLE . do i have to alter table externally or do i have a way of giving CMR_FIELD_TYPE Nullable in jdbccmp-jboss.xml.
ur response is appreciated.
Thanks.
leela -
7. Re: Database foreign keys must be "not null"?
leela Aug 6, 2002 11:33 AM (in response to Marco DeFreitas)I have foreign Key Type INTEGER , How to make it NULLABLE . do i have to alter table externally or do i have a way of giving CMR_FIELD_TYPE Nullable in jdbccmp-jboss.xml.
ur response is appreciated.
Thanks.
leela -
8. Re: Database foreign keys must be "not null"?
leela Aug 6, 2002 11:40 AM (in response to Marco DeFreitas)How to make foreign Keys nullable.
-
9. Re: Database foreign keys must be "not null"?
Dain Sundstrom Aug 6, 2002 3:01 PM (in response to Marco DeFreitas)Foreign keys are automatically nullable. What database are you using?
-
10. Re: Database foreign keys must be "not null"?
leela Aug 6, 2002 3:59 PM (in response to Marco DeFreitas)mysql
-
11. Re: Database foreign keys must be "not null"?
Dain Sundstrom Aug 6, 2002 6:12 PM (in response to Marco DeFreitas)Do you have already existing tables or are you allowing jboss to create the tables for you? Are you using foreign key constraints? If so try turning of the generation of foreign key constraints (maybe mySQL is marking the column as not null).
Have you tried executing the sql by hand using the mySQL query tool? What errors do you get from the tool? -
12. Re: Database foreign keys must be "not null"?
leela Aug 7, 2002 10:32 AM (in response to Marco DeFreitas)Yes , It worked. I turned off Foreign Key constraints in the default section of jbosscmp-jdbc.xml.
Thanks Dain.
Leela