Hibernate - How to provide right mapping to integer type?

hibernate, java, maven, mysql

Solution

Use @Basic for basic integers. You can always trying declaring your ID as a Long though. I usually always use Long for my IDs. See Mapping Identifier Properities:

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

Problem

I'm executing my maven build and it throws this exception: `Last cause: Wrong column type in x.clients for column type. Found: tinyint, expected: integer` I'm mapping like this: ``` @Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; ``` And I'm creating the column using InnoDB like this: `id int NOT NULL UNIQUE AUTO_INCREMENT` Shouldn't this be ok? Why is it saying that he is finding tinyint?

Original source