2 Replies Latest reply on Sep 18, 2009 3:07 AM by harsha hn

    @Column atttributes name and length does not work in JBoss5.

    harsha hn Newbie


      public class ColumnAttribsTesting {
       private Integer id;
       private Integer column1 ;
       private Integer column2 ;
       public ColumnAttribsTesting() {
       public Integer getId() {
       return id;
       public void setId(Integer id) {
       this.id = id;
       @Column(name = "abcde", length=1024)
       public Integer getColumn1() {
       return column1;
       public void setColumn1(Integer column1) {
       this.column1 = column1;
       public Integer getColumn2() {
       return column2;
       public void setColumn2(Integer column2) {
       this.column2 = column2;

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
       http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
       <persistence-unit name="atspu" transaction-type="JTA">
       <property name="hibernate.hbm2ddl.auto" value="update" />
       <property name="hibernate.show_sql" value="true"/>
       <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"></property>
       <property name="hibernate.transaction.manager_lookup_class"
       value="org.hibernate.transaction.JBossTransactionManagerLookup" />

      the table get created. but jpa does not create a column with the name abcde but column1, and the length is always defaults to 255 chars irrespective of the length attribute

      i wonder how the basic annotation does not work in JPA.

      Am i missing something? mysql installation, mysql-ds.xml are fine

      please help