3 Replies Latest reply on Feb 15, 2005 5:40 PM by The FreeCake

    @Column

    Abdennour Laaroubi Newbie

      I am using EJB 3.0 preview 2.
      I have noticed two problems with @Column annotation:

      1- If I enter something like @Column( length=80), the jar will not be deployed. If I change that to @Column(name="xxx", length=80), then I can deploy the package.ejb3 file.
      According to the specification, the name is optional????

      2- Following instructions that I mentionned in issue 1 only solve the problem of the deployment. However, specifying the length seems to be ignored by JBOSS\Hibernate. The tables are still created with the default length(255 for varchar).
      I read the forum and couldn't find any similar issue???
      Please let me know if I am missing something here???

        • 1. Re: @Column
          Abdennour Laaroubi Newbie

          Can someone please help?

          • 2. Re: @Column
            Mike Duffy Novice

            In section, "10.1.5 Column Annotation", the spec states, "If a Column annotation is not specified, or if the name annotation member is missing, the column name defaults to the persistent property or field name."

            Your post stated, " If I enter something like @Column( length=80), the jar will not be deployed. If I change that to @Column(name="xxx", length=80), then I can deploy the package.ejb3 file. "

            It may simply be that your field name does not correspond to a column in your table, or it may be that this part of the spec is not yet implemented in the preview release.

            Mike

            • 3. Re: @Column
              The FreeCake Newbie

              Hello,

              Is actually @Column lenght attribute supported by the jboss-head branche ?

              Because jboss create a varchar(255) column despite I tag @Column(name="login",length=20) before my getter ...

              My jobss version is jboss-head checked out today ... and I think I do not have make something wrong ...

               @Column(name="login",length=20)
               public String getLogin()
               {
               return login ;
               }
              


              hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
              hibernate.hbm2ddl.auto=create-drop
              hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
              hibernate.connection.datasource=java:/MyDataSourceDS
              hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect