1 Reply Latest reply on Jul 13, 2016 9:46 AM by bmajsak

    JPA @Column annotation and Arquillian issue

    ecabrerar

      Few months ago, i was working with Arquillian and Wildfly 8.2 for first time.

      I noticed  there is an issue with the JPA @Column annotation.

       

      For example:

       

      
      @Entity
      
      @Table(name = "building")
      
      public class Building extends BusinessEntityName<Long> {
      
      
      
          private static final long serialVersionUID = 1L;
      
        
      
          ..................
      
      
      
          @Column(name = "number_of_floor", nullable = false)
      
          private short numberOfFloors;
      
      
      
          @Column(name = "number_apart_per_floor", nullable = false)
      
          private short numberApartmentPerFloor;
      
      
      
          @Column(name = "register_date", nullable = false)
      
          private Date registerDate;
      
         ...................
      
        }
      

       

       

      JPA created the table 'building' with  fields 'number_of_floor','number_apart_per_floor' and 'register_date', but when you use the Arquillian annotation '@ShouldMatchDataSet',  it's expecting the fields 'numberOfFloors','numberApartmentPerFloor' and 'registerDate'.

       

      My quick solution was removing the @Column annotation, but now, JPA created the building table with field like the entity definition, ie. numberOfFloors, numberApartmentPerFloor, registerDate. We really need the fields with our database  conversion, 'number_of_floor','number_apart_per_floor' and 'register_date'.

       

      If you have any information about how to solve this issue, please let me know.

      !

      Thanks in advance.