3 Replies Latest reply on Jan 3, 2003 11:44 AM by t g

    CMR non nullable field

    John Tran Newbie

      Hi,

      We have a CMR field that mapps to a non nullable foreign key column. At time of create, with out the CMP field mapped to this foreign key, we get a database error that says "java.sql.SQLException: ORA-01400: cannot insert NULL into ("TCM"."TCMSECESC"."SECURITYID")". However when we put in the CMP field we get the following error: "java.sql.SQLException: ORA-00957: duplicate column name".

      Is there any way to get this to work without changing our database design to allow the foreign key field to be null?

      Thanks in advance.

        • 1. Re: CMR non nullable field
          Dain Sundstrom Master

          JBoss does not support non-nullable foreign key fields.

          • 2. Re: CMR non nullable field
            Ignacio de Cordoba Novice

            Do you know if there are any plans to address this in the future?
            I know that in EJB 2.0 Specs, 1..0-n relations are not supported, but many programmers (myself at least) feel much more confortable if we can have a strict database structure that doesn't allow inconsistent data (for example, newsletter subscribers subscribed to no newsletters).

            Is there any workarround on this? (A part of beeing very careful with app code)

            Thanks and greetings from Madrid

            • 3. Re: CMR non nullable field
              t g Newbie

              This must be a popular problem, because I have talked to experienced database pros and they consider the idea of adding a child or "Many" table with a null foreign key as bad from a database standpoint. It breaks good database design they say. This is such a serious problem that we are looking to move to Weblogic.