0 Replies Latest reply on Aug 12, 2015 6:03 PM by ecabrerar

    JPA @Column annotation and Arquillian issue

    ecabrerar

      I'm working in my first project with Arquillian and Wildfly 8.2.

      At first, everything was as i was expecting, but the last two days, I spent several hours trying to resolve an issues with one of the test case.

      Last night, 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.

       

      Best regards