Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3806

EJB3- Dynamically created column(attribute) in the database does not honour "nullable=false" annotation property on Column Annotation...

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • No Release
    • JBossAS-4.0.4.GA, JBossAS-4.0.5.GA
    • EJB
    • None
    • windows xp, mysql 4.x

    • Workaround Exists
    • Hide

      to create ddl all the time and use it before deploying the application, to bypass dynamic creation of tables/fields.
      This is painful in our case, because this involves additional work and maintenance.

      Show
      to create ddl all the time and use it before deploying the application, to bypass dynamic creation of tables/fields. This is painful in our case, because this involves additional work and maintenance.

      I have an attribute on the class.....
      Class name is classA and the attribute is sequenceNumber.

      Here is the annotation for that attribute for that class..

      @Column(name="sequenceNumber",nullable=false)

      public int getSequenceNumber()

      { return sequenceNumber; }

      When I generate ddl using hibernate tools, the generated schema has ' not null' for sequenceNumber field, which is PERFECT.

      But when I let jboss/ejb3.0 create the tables and fields dynamically (when the app is deployed) , the sequenceNumber is set as ALLOW NULL , in the database which is NOT CORRECT.

      I don't understand why would the behavior be different in different cases if jboss is using the same hibernate to create ddl at runtime.

      Hope I'm clear.

              patriot1burke@gmail.com Bill Burke (Inactive)
              balrupa_jira Balaji Narasimhan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: