Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] MySQL & AUTO_INCREMENT

Hi!

I'm trying to use MySQL's auto_increment feature.

My Entity has a property annotated like this:

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

When creating EntityManagerFactory, I pass in:

commonConfig.put(PersistenceUnitProperties.TARGET_DATABASE, TargetDatabase.MySQL);
    commonConfig.put(PersistenceUnitProperties.NATIVE_SQL, "true");

But I still keep getting the exception:

com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'mydb.SEQUENCE' doesn't exist

Whay else must I do?

Regards,
 Jaka


Back to the top