Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » DDL & MySQL & Primary Key
DDL & MySQL & Primary Key [message #1769021] Tue, 25 July 2017 18:32 Go to next message
Anthony Levesque is currently offline Anthony LevesqueFriend
Messages: 3
Registered: May 2017
Junior Member
Hello,

I am trying to use DDL to generate my database automatically BUT this case causes an error :

  • @Id on a String
  • MySQL database

It generates this code with an "AUTO_INCREMENT" on a "VARCHAR" :

  • CREATE TABLE t_systeme (PARAM VARCHAR(255) AUTO_INCREMENT NOT NULL, DESCRIPTION VARCHAR(255), VALEUR VARCHAR(255), REF_SOCIETE INTEGER, PRIMARY KEY (PARAM))

Why ? How to fix this ?

Thanks in advance.
Re: DDL & MySQL & Primary Key [message #1769112 is a reply to message #1769021] Wed, 26 July 2017 15:29 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Not sure what you are looking for. Why are you using ID generation on a string value, should it not be an Integer type in your object?

Your Id likely has the @GeneratedValue(strategy=GenerationType.IDENTITY) annotation that you either need to remove and set the values yourself, or switch it to a numeric like Integer.

[Updated on: Wed, 26 July 2017 15:43]

Report message to a moderator

Previous Topic:Persist with secondaryTable from non PK field
Next Topic:Setting up cache coordination with Payara
Goto Forum:
  


Current Time: Tue Mar 19 03:47:43 GMT 2024

Powered by FUDForum. Page generated in 0.02530 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top