Search code examples
javamysqljpaeclipselink

EclipseLink doesn't recognize int(11) in MySQL


I know when I create a table with column data == int. I get something like int(11) as data type for this column. This somehow messes up my EclipseLink when auto generating Entities from Table. Eclipse doesn't understand int(11) as the data type so it converts everything to String instead of int. My question is how to tell MySql to stop showing this (11) thing? Or how to tell EclipseLink that this is a int?


Solution

  • Just found out when generating the entity, click on the id and eclipselink will allow you to select the mapping type. Choose int instead of String will do the trick.